How do I calculate percentiles with python/numpy?

Is there a convenient way to calculate percentiles for a sequence or single-dimensional numpy array? I am looking for something similar to Excel’s percentile function. I looked in NumPy’s statistics reference, and couldn’t find this. All I could find is the median (50th percentile), but not something more specific. 12 Answers 12

How to normalize a NumPy array to a unit vector?

I would like to convert a NumPy array to a unit vector. More specifically, I am looking for an equivalent version of this normalisation function: def normalize(v): norm = np.linalg.norm(v) if norm == 0: return v return v / norm This function handles the situation where vector v has the norm value of 0. Is … Read more

Blog statistics

I run small wordpress blog with 3-5 users. People add/edit/remove and read content all the time… What I want is to be able to see some sort of statistics…. which posts/pages are most popular, most updated, commented… which external links are the ones clicked most times… etc…. is there a plugin (not external service) to … Read more

Generating statistics from Git repository [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for Stack Overflow. Closed 1 year ago. Improve this question I’m looking for some good tools/scripts that allow me to generate a few statistics from a git repository. I’ve … Read more

How to find the statistical mode?

In R, mean() and median() are standard functions which do what you’d expect. mode() tells you the internal storage mode of the object, not the value that occurs the most in its argument. But is there is a standard library function that implements the statistical mode for a vector (or list)? 35 Answers 35