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

Function value_counts_aggregate

dask/dataframe/methods.py:368–383  ·  view source on GitHub ↗
(
    x, total_length=None, sort=True, ascending=False, normalize=False, **groupby_kwargs
)

Source from the content-addressed store, hash-verified

366
367
368def value_counts_aggregate(
369 x, total_length=None, sort=True, ascending=False, normalize=False, **groupby_kwargs
370):
371 out = value_counts_combine(x, **groupby_kwargs)
372 if normalize:
373 out /= total_length if total_length is not None else out.sum()
374 if sort:
375 if PANDAS_GE_300:
376 # pandas 3.x ensures that value_counts is stable.
377 kind = "stable"
378 else:
379 kind = "quicksort"
380 out = out.sort_values(ascending=ascending, kind=kind)
381 if normalize:
382 out.name = "proportion"
383 return out
384
385
386def nbytes(x):

Callers

nothing calls this directly

Calls 3

value_counts_combineFunction · 0.85
sort_valuesMethod · 0.80
sumMethod · 0.45

Tested by

no test coverage detected