bach.Series.mode

mode

(partition=None, skipna=True)

[source]

Returns the mode in each partition or for all values if none is given.

Parameters

  • partition (Union[GroupBy, DataFrame]) – The partition or window to apply
  • skipna (bool) – only skipna=True supported. This means NULL values are ignored.

Returns

a new Series with the aggregation applied

Return type

bach.series.series.SeriesSubType

danger

The result of this function might be non-deterministic if there are multiple values with the same frequency.

note

BigQuery has no support for aggregation function MODE, therefore APPROX_TOP_COUNT approximate aggregate function is used instead. Which means that an approximate result will be produced instead of exact results.

For more information: https://cloud.google.com/bigquery/docs/reference/standard-sql/approximate_aggregate_functions#approx_top_count