scipy.stats.

find_repeats#

scipy.stats.find_repeats(arr)[source]#

Find repeats and repeat counts.

Deprecated since version 1.15.0: This function is deprecated as of SciPy 1.15.0 and will be removed in SciPy 1.17.0. Please use numpy.unique / numpy.unique_counts instead.

Parameters:
arrarray_like

Input array. This is cast to float64.

Returns:
valuesndarray

The unique values from the (flattened) input that are repeated.

countsndarray

Number of times the corresponding ‘value’ is repeated.

Notes

In numpy >= 1.9 numpy.unique provides similar functionality. The main difference is that find_repeats only returns repeated values.

Examples

>>> from scipy import stats
>>> stats.find_repeats([2, 1, 2, 3, 2, 2, 5])
RepeatedResults(values=array([2.]), counts=array([4]))
>>> stats.find_repeats([[10, 20, 1, 2], [5, 5, 4, 4]])
RepeatedResults(values=array([4.,  5.]), counts=array([2, 2]))