scipy.stats.mode

Return an array of the most common values in the input array.

Python3

# importing the stats module
from scipy import stats as st
 
# sample input array
array = [[2, 3], [3, 1], [1, 3],\
         [3, 3], [4, 2], [4, 4],\
         [1, 2], [5, 6]]
 
# calling the mode function
print(st.mode(array))

                    

Output:

ModeResult(mode=array([[1, 3]]), count=array([[2, 3]]))

SciPy – Stats

The scipy.stats is the SciPy sub-package. It is mainly used for probabilistic distributions and statistical operations. There is a wide range of probability functions.

There are three classes:

Class

Description

rv_continuousFor continuous random variables, we can create specialized distribution subclasses and instances.
rv_discreteFor discrete random variables, we can create specialized distribution subclasses and instances.
rv_histogramgenerate specific distribution histograms.

Similar Reads

Continuous Random Variables

A continuous random variable is a probability distribution when the random variable X can have any value. The mean is defined by the location (loc) keyword. The standard deviation is determined by the scale (scale) keyword....

Discrete Random Variables

...

Result analysis

Only a countable number of values can be assigned to discrete random variables. L is an additional integer parameter that can be added to any discrete distribution. The general distribution p and the standard distribution p0 have the following relationship:...

scipy.stats.kurtosis

...

scipy.stats.mstats.zscore

...

scipy.stats.skew

...

scipy.stats.energy_distance

...

scipy.stats.mode

...

scipy.stats.variation

Kurtosis quantifies how much of a probability distribution’s data are concentrated towards the mean as opposed to the tails....

scipy.stats.rankdata

...

Contact Us