pyarrow.compute.value_counts(array, *, memory_pool=None)

Compute counts of unique elements.

For each distinct value, compute the number of times it occurs in the array. The result is returned as an array of struct<input type, int64>. Nulls in the input are ignored.

  • array (Array-like) – Argument to compute function

  • memory_pool (pyarrow.MemoryPool, optional) – If not passed, will allocate memory from the default memory pool.