scipy.stats.rankdata
Assign ranks to data, dealing with ties appropriately.
Python3
# importing the stats module from scipy import stats as st # sample input array array = [ 2 , 3 , 15 , 1 , 6 , 9 , 8 , 4 , 5 , 10 ] # calling the function print (st.rankdata(array)) |
Output:
[ 2. 3. 10. 1. 6. 8. 7. 4. 5. 9.]
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_continuous | For continuous random variables, we can create specialized distribution subclasses and instances. |
rv_discrete | For discrete random variables, we can create specialized distribution subclasses and instances. |
rv_histogram | generate specific distribution histograms. |
Contact Us