This is a pre-release version (2.0.0.dev0+git20260907.41eeb59).Go to latest (1.18.0)
{ } Raw JSON

bundles / scipy 2.0.0.dev0+git20260907.41eeb59 / scipy / stats / _mstats_basic / find_repeats

function

scipy.stats._mstats_basic:find_repeats

source: build-install/usr/lib/python3.14/site-packages/scipy/stats/_mstats_basic.py:171

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])
✓
(array([2.]), array([4]))
In the above example, 2 repeats 4 times.
mstats.find_repeats([[10, 20, 1, 2], [5, 5, 4, 4]])
✓
(array([4., 5.]), array([2, 2]))
In the above example, both 4 and 5 repeat 2 times.

Aliases

  • scipy.stats._mstats_basic.find_repeats