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

Function pivot_count

dask/dataframe/methods.py:457–468  ·  view source on GitHub ↗
(df, index, columns, values)

Source from the content-addressed store, hash-verified

455
456
457def pivot_count(df, index, columns, values):
458 # we cannot determine dtype until concatenationg all partitions.
459 # make dtype deterministic, always coerce to np.float64
460 return pd.pivot_table(
461 df,
462 index=index,
463 columns=columns,
464 values=values,
465 aggfunc="count",
466 dropna=False,
467 observed=False,
468 ).astype(np.float64)
469
470
471def pivot_first(df, index, columns, values):

Callers

nothing calls this directly

Calls 2

pivot_tableMethod · 0.80
astypeMethod · 0.45

Tested by

no test coverage detected