Hacker News new | ask | show | jobs
by chestervonwinch 2983 days ago
...

    n = x.shape[0]
1 comments

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.