scipy.stats.mstats.

rankdata#

scipy.stats.mstats.rankdata(data, axis=None, use_missing=False)[source]#

Returns the rank (also known as order statistics) of each data point along the given axis.

If some values are tied, their rank is averaged. If some values are masked, their rank is set to 0 if use_missing is False, or set to the average rank of the unmasked values if use_missing is True.

Deprecated since version 2.0.0: scipy.stats.mstats.rankdata is deprecated as of SciPy 2.0.0 and will be removed, along with the scipy.stats.mstats namespace, in SciPy 2.4.0. For similar functionality, use scipy.stats.rankdata with MArray(s) instead of NumPy masked array(s).

Parameters:
datasequence

Input data. The data is transformed to a masked array

axis{None,int}, optional

Axis along which to perform the ranking. If None, the array is first flattened. An exception is raised if the axis is specified for arrays with a dimension larger than 2

use_missingbool, optional

Whether the masked values have a rank of 0 (False) or equal to the average rank of the unmasked values (True).