scipy.stats.mstats.count_tied_groups

scipy.stats.mstats.count_tied_groups(x, use_missing=False)[source]
Counts the number of tied values in x, and returns a dictionary
(nb of ties: nb of groups).
Parameters :

x : sequence

Sequence of data on which to counts the ties

use_missing : boolean

Whether to consider missing values as tied.

Examples

>>> z = [0, 0, 0, 2, 2, 2, 3, 3, 4, 5, 6]
>>> count_tied_groups(z)
>>> {2:1, 3:2}
>>> # The ties were 0 (3x), 2 (3x) and 3 (2x)
>>> z = ma.array([0, 0, 1, 2, 2, 2, 3, 3, 4, 5, 6])
>>> count_tied_groups(z)
>>> {2:2, 3:1}
>>> # The ties were 0 (2x), 2 (3x) and 3 (2x)
>>> z[[1,-1]] = masked
>>> count_tied_groups(z, use_missing=True)
>>> {2:2, 3:1}
>>> # The ties were 2 (3x), 3 (2x) and masked (2x)

Previous topic

scipy.stats.mstats.chisquare

Next topic

scipy.stats.mstats.describe