VOOZH about

URL: https://www.geeksforgeeks.org/python/scipy-stats-mean-function-python/

⇱ sciPy stats.mean() function | Python - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

sciPy stats.mean() function | Python

Last Updated : 10 Feb, 2019
scipy.stats.mean(array, axis=0) function calculates the arithmetic mean of the array elements along the specified axis of the array (list in python). It's formula - 👁 Image
Parameters : array: Input array or object having the elements to calculate the arithmetic mean. axis: Axis along which the mean is to be computed. By default axis = 0 Returns : Arithmetic mean of the array elements based on the set parameters.
Code #1:
Output:
Arithmetic Mean is : 10.3333333333
Code #2: With multi-dimensional data
Output:
Arithmetic Mean is : 6.41666666667

Arithmetic Mean is with default axis = 0 : 
 [ 3.5 4.75 11. ]

Arithmetic Mean is with default axis = 1 : 
 [ 10.33333333 4.33333333 5.33333333 5.66666667]
Comment