{ } Raw JSON

bundles / scipy 1.17.1 / scipy / stats / _mstats_basic / find_repeats

function

scipy.stats._mstats_basic:find_repeats

source: /scipy/stats/_mstats_basic.py :175

Signature

def   find_repeats ( arr )

Summary

Find repeats in arr and return a tuple (repeats, repeat_count).

Extended Summary

The input is cast to float64. Masked values are discarded.

Parameters

arr : sequence

Input array. The array is flattened if it is not 1D.

Returns

repeats : ndarray

Array of repeated values.

counts : ndarray

Array of counts.

Examples

from scipy.stats import mstats
mstats.find_repeats([2, 1, 2, 3, 2, 2, 5])
In the above example, 2 repeats 4 times.
mstats.find_repeats([[10, 20, 1, 2], [5, 5, 4, 4]])
In the above example, both 4 and 5 repeat 2 times.

Aliases

  • scipy.stats._mstats_basic.find_repeats