MCPcopy Create free account
hub / github.com/dask/dask / _mode_aggregate

Function _mode_aggregate

dask/dataframe/core.py:367–376  ·  view source on GitHub ↗
(df, dropna)

Source from the content-addressed store, hash-verified

365
366
367def _mode_aggregate(df, dropna):
368 value_count_series = df.sum()
369 max_val = value_count_series.max(skipna=dropna)
370 mode_series = (
371 value_count_series[value_count_series == max_val]
372 .index.to_series()
373 .sort_values()
374 .reset_index(drop=True)
375 )
376 return mode_series
377
378
379def safe_head(df, n):

Callers

nothing calls this directly

Calls 5

reset_indexMethod · 0.80
sort_valuesMethod · 0.80
sumMethod · 0.45
maxMethod · 0.45
to_seriesMethod · 0.45

Tested by

no test coverage detected