dask.dataframe.reshape.pivot_table

dask.dataframe.reshape.pivot_table

dask.dataframe.reshape.pivot_table(df, index=None, columns=None, values=None, aggfunc='mean')[source]

Create a spreadsheet-style pivot table as a DataFrame. Target columns must have category dtype to infer result’s columns. index, columns, and aggfunc must be all scalar. values can be scalar or list-like.

Parameters
dfDataFrame
indexscalar

column to be index

columnsscalar

column to be columns

valuesscalar or list(scalar)

column(s) to aggregate

aggfunc{‘mean’, ‘sum’, ‘count’, ‘first’, ‘last’}, default ‘mean’
Returns
tableDataFrame