pyarrow.compute.hash_approximate_median

pyarrow.compute.hash_approximate_median(array, group_id_array, *, memory_pool=None, options=None, skip_nulls=True, min_count=1)

Calculate approximate medians of a numeric array with the T-Digest algorithm.

Nulls and NaNs are ignored. Null is emitted for a group if there are no valid data points.

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

  • group_id_array (Array-like or scalar-like) – Argument to compute function

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

  • options (pyarrow.compute.ScalarAggregateOptions, optional) – Parameters altering compute function semantics.

  • skip_nulls (optional) – Parameter for ScalarAggregateOptions constructor. Either options or skip_nulls can be passed, but not both at the same time.

  • min_count (optional) – Parameter for ScalarAggregateOptions constructor. Either options or min_count can be passed, but not both at the same time.