sciPy stats.gmean() function | Python Last Updated : 02 Aug, 2024 Comments Improve Suggest changes Like Article Like Report scipy.stats.gmean(array, axis=0, dtype=None) calculates the geometric mean of the array elements along the specified axis of the array (list in python). It's formula - Parameters : array: Input array or object having the elements to calculate the geometric mean. axis: Axis along which the mean is to be computed. By default axis = 0 dtype: It sets the type of returned element.Returns : Geometric mean of the array elements based on the set parameters.Code #1: Python3 # Geometric Mean from scipy.stats.mstats import gmean arr1 = gmean([1, 3, 27]) print("Geometric Mean is :", arr1) OutputGeometric Mean is : 4.32674871092 Code #2: With multi-dimensional data Python3 # Geometric Mean from scipy.stats.mstats import gmean arr1 = [[1, 3, 27], [3, 4, 6], [7, 6, 3], [3, 6, 8]] print("Geometric Mean is :", gmean(arr1)) # using axis = 0 print("\nGeometric Mean is with default axis = 0 : \n", gmean(arr1, axis = 0)) # using axis = 1 print("\nGeometric Mean is with default axis = 1 : \n", gmean(arr1, axis = 1)) OutputGeometric Mean is : [ 2.81731325 4.55901411 7.89644408] Geometric Mean is with default axis = 0 : [ 2.81731325 4.55901411 7.89644408] Geometric Mean is with default axis = 1 : [ 4.32674871 4.16016765 5.01329793 5.24148279] Comment More infoAdvertise with us Next Article sciPy stats.gmean() function | Python V vishal3096 Follow Improve Article Tags : Python Python-scipy Python scipy-stats-functions Practice Tags : python Similar Reads sciPy stats.mean() function | Python 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 - Parameters : array: Input array or object having the elements to calculate the arithmetic mean. axis: Axis along which the mean is to b 1 min read sciPy stats.nanmean() function | Python scipy.stats.nanmean(array, axis=0) function calculates the arithmetic mean by ignoring the Nan (not a number) values of the array elements along the specified axis of the array. It's formula - Parameters : array : Input array or object having the elements, including Nan values, to calculate the arit 2 min read scipy stats.moment() function | Python scipy.stats.moment(array, axis=0) function calculates the nth moment about the mean for a sample i.e. array elements along the specified axis of the array (list in python). Its formula - Parameters : array : Input array or object having the elements to calculate the moment. axis : Axis along which t 2 min read scipy stats.normaltest() function | Python scipy.stats.normaltest(array, axis=0) function test whether the sample is different from the normal distribution. This function tests the null hypothesis of the population that the sample was drawn from. Parameters : array : Input array or object having the elements. axis : Axis along which the norm 1 min read sciPy stats.sem() function | Python scipy.stats.sem(arr, axis=0, ddof=0) function is used to compute the standard error of the mean of the input data. Parameters : arr : [array_like]Input array or object having the elements to calculate the standard error. axis : Axis along which the mean is to be computed. By default axis = 0. ddof : 1 min read sciPy stats.tsem() function | Python scipy.stats.tsem(array, limits=None, inclusive=(True, True)) calculates the trimmed standard error of the mean of array elements along the specified axis of the array. Its formula :- Parameters : array: Input array or object having the elements to calculate the trimmed standard error of the mean. ax 2 min read sciPy stats.hmean() | Python scipy.stats.hmean(array, axis=0, dtype=None) calculates the harmonic mean of the array elements along the specified axis of the array (list in python). It's formula - Parameters : array: Input array or object having the elements to calculate the harmonic mean. axis: Axis along which the mean is to b 2 min read statistics mean() function - Python The mean() function from Pythonâs statistics module is used to calculate the average of a set of numeric values. It adds up all the values in a list and divides the total by the number of elements. For example, if we have a list [2, 4, 6, 8], the mean would be (2 + 4 + 6 + 8) / 4 = 5.0. This functio 4 min read scipy stats.kurtosis() function | Python scipy.stats.kurtosis(array, axis=0, fisher=True, bias=True) function calculates the kurtosis (Fisher or Pearson) of a data set. It is the fourth central moment divided by the square of the variance. It is a measure of the "tailedness" i.e. descriptor of shape of probability distribution of a real-va 2 min read scipy stats.cosine() | Python scipy.stats.cosine() is an cosine continuous random variable that is defined with a standard format and some shape parameters to complete its specification. Parameters : q : lower and upper tail probability x : quantiles loc : [optional]location parameter. Default = 0 scale : [optional]scale paramet 2 min read Like