scipy.stats.mstats.
mode#
- scipy.stats.mstats.mode(a, axis=0)[Quelle]#
Gibt ein Array des modalen (häufigsten) Wertes im übergebenen Array zurück.
- Parameter:
- aarray_like
n-dimensionales Array, dessen Modus/Modi gefunden werden soll(en).
- axisint oder None, optional
Achse, entlang der operiert werden soll. Standard ist 0. Wenn None, wird über das gesamte Array a berechnet.
- Rückgabe:
- modendarray
Array der modalen Werte.
- countndarray
Array der Anzahlen für jeden Modus.
Hinweise
Weitere Details finden Sie unter
scipy.stats.mode.Beispiele
>>> import numpy as np >>> from scipy import stats >>> from scipy.stats import mstats >>> m_arr = np.ma.array([1, 1, 0, 0, 0, 0], mask=[0, 0, 1, 1, 1, 0]) >>> mstats.mode(m_arr) # note that most zeros are masked ModeResult(mode=array([1.]), count=array([2.]))