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

Method pivot_table

dask/dataframe/dask_expr/_collection.py:3692–3712  ·  view source on GitHub ↗

Create a spreadsheet-style pivot table as a DataFrame. Target ``columns`` must have category dtype to infer result's ``columns``. ``index``, ``columns``, ``values`` and ``aggfunc`` must be all scalar. Parameters ---------- values : scalar

(self, index, columns, values, aggfunc="mean")

Source from the content-addressed store, hash-verified

3690 return new_collection(expr.AddSuffix(self, suffix))
3691
3692 def pivot_table(self, index, columns, values, aggfunc="mean"):
3693 """
3694 Create a spreadsheet-style pivot table as a DataFrame. Target ``columns``
3695 must have category dtype to infer result's ``columns``.
3696 ``index``, ``columns``, ``values`` and ``aggfunc`` must be all scalar.
3697
3698 Parameters
3699 ----------
3700 values : scalar
3701 column to aggregate
3702 index : scalar
3703 column to be index
3704 columns : scalar
3705 column to be columns
3706 aggfunc : {'mean', 'sum', 'count'}, default 'mean'
3707
3708 Returns
3709 -------
3710 table : DataFrame
3711 """
3712 return pivot_table(self, index, columns, values, aggfunc)
3713
3714 @property
3715 def iloc(self):

Callers 11

test_pivot_tableFunction · 0.95
pivot_sumFunction · 0.80
pivot_countFunction · 0.80
pivot_firstFunction · 0.80
pivot_lastFunction · 0.80
test_pivot_tableFunction · 0.80
test_pivot_table_failsFunction · 0.80
test_pivot_table_dtypeFunction · 0.80
test_pivot_table_errorsFunction · 0.80

Calls 1

pivot_tableFunction · 0.85

Tested by 7

test_pivot_tableFunction · 0.76
test_pivot_tableFunction · 0.64
test_pivot_table_failsFunction · 0.64
test_pivot_table_dtypeFunction · 0.64
test_pivot_table_errorsFunction · 0.64