Basic Statistical Operations on NumPy ArraysBasic Statistical Operations on NumPy Arrays

NumPy provides a number of functions for performing basic statistical operations on numPy arrays. Some examples include:

  • mean(): Calculates the mean (average) of the elements in an array;
  • median(): Calculates the median (middle value) of the elements in an array;
  • std(): Calculates the standard deviation of the elements in an array;
  • var(): Calculates the variance of the elements in an array;
  • min(): Finds the minimum value in an array;
  • max(): Finds the maximum value in an array;
  • argmin(): Finds the index of the minimum value in an array;
  • argmax(): Finds the index of the maximum value in an array.

Task

  1. Create an array with 10 random values;
  2. Calculate the mean of the array;
  3. Calculate the median of the array;
  4. Calculate the standard deviation of the array;
  5. Calculate the variance of the array.

Everything was clear?

Section 1. Chapter 4

Start learning today and achieve
coding mastery

  • Master Python, SQL, JavaScript & more.
  • Learn with Step-by-Step Lessons.
  • Get Ready for Real-World Projects.
  • Earn a Certificate Upon Completion.