Y
Hacker News
new
|
ask
|
show
|
jobs
by
quietbritishjim
2983 days ago
Or just len(x). This works perfectly well on numpy arrays and has the bonus that it works on regular lists/tuples of floats, so the first snippet doesn't rely on numpy.