larray.Array.value_counts

Array.value_counts()[source]

Count number of occurrences of each unique value in array.

Returns
Array of ints

The number of occurrences of each unique value in the input array.

See also

Array.unique

Examples

>>> arr = Array([5, 2, 5, 5, 2, 3, 7], "a=a0..a6")
>>> arr
a  a0  a1  a2  a3  a4  a5  a6
    5   2   5   5   2   3   7
>>> arr.value_counts()
value  2  3  5  7
       2  1  3  1