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

Function pivot_count

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

Source from the content-addressed store, hash-verified

449
450
451def pivot_count(df, index, columns, values):
452 # we cannot determine dtype until concatenationg all partitions.
453 # make dtype deterministic, always coerce to np.float64
454 return pd.pivot_table(
455 df,
456 index=index,
457 columns=columns,
458 values=values,
459 aggfunc="count",
460 dropna=False,
461 observed=False,
462 ).astype(np.float64)
463
464
465def 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