From the course: Python Functions for Data Science

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Statistical operations on NumPy arrays

Statistical operations on NumPy arrays - Python Tutorial

From the course: Python Functions for Data Science

Start my 1-month free trial

Statistical operations on NumPy arrays

- [Instructor] The Numpy library supports statistical operations on Numpy arrays. I'll be walking through some examples to show you Numpy functions that enable statistical operations. First, I'm initializing a variable named arrayA as a Numpy array that represents the scores of participants in a competition. Let's say I want to compute the median of scores. To do this, I can call Numpy's median function and pass in scores. It would look like this. Now say I want to compute the mean of scores. I can call Numpy's mean function and pass in scores. It would look like this. Next, I want to compute the variance of scores. I can call Numpy's var function and pass in scores, like this. Lastly, to compute the standard deviation of scores, I can call Numpy's std function and pass in scores. It will look like this. There we go. Now that you've seen how Numpy's statistical functions are used, keep them in mind when you work…

Contents