scipy.stats.mstats.

count_tied_groups#

scipy.stats.mstats.count_tied_groups(x, use_missing=False)[Quelle]#

Zählt die Anzahl von gebundenen Werten.

Parameter:
xSequenz

Sequenz von Daten, für die die Bindungen gezählt werden

use_missingbool, optional

Ob fehlende Werte als gebunden betrachtet werden sollen.

Rückgabe:
count_tied_groupsdict

Gibt ein Wörterbuch zurück (Anzahl der Bindungen: Anzahl der Gruppen).

Beispiele

>>> from scipy.stats import mstats
>>> import numpy as np
>>> z = [0, 0, 0, 2, 2, 2, 3, 3, 4, 5, 6]
>>> mstats.count_tied_groups(z)
{2: 1, 3: 2}

Im obigen Beispiel waren die Bindungen 0 (3x), 2 (3x) und 3 (2x).

>>> z = np.ma.array([0, 0, 1, 2, 2, 2, 3, 3, 4, 5, 6])
>>> mstats.count_tied_groups(z)
{2: 2, 3: 1}
>>> z[[1,-1]] = np.ma.masked
>>> mstats.count_tied_groups(z, use_missing=True)
{2: 2, 3: 1}