Pivot Table

Pivot table, powered by SQL.

Required Inputs

  • Values: a dictionary of the column with values you want to aggregate & the method of aggregation for your values

Optional Inputs

  • Rows: column(s) to group by down

  • Columns: column(s) to pivot across

  • Filters: filters to apply

Notes

  • Applies a hard limit of 500 distinct values in the 'columns' column

Parameters

Example

ds2 = ds.pivot_table(
  rows=['DATE'],
  values={
      'CLOSE': ['SUM', 'AVG'],
      'OPEN': ['SUM', 'AVG']
  },
  columns='SYMBOL',
)
ds2.preview()

Source Code

Last updated