Skip to main content
Version: Next

ChartDataPivotOptionsSchema

aggregatesobject

The keys are the name of the aggregate column to be created, and the values specify the details of how to apply the aggregation. If an operator requires additional options, these can be passed here to be unpacked in the operator call. The following numpy operators are supported: average, argmin, argmax, cumsum, cumprod, max, mean, median, nansum, nanmin, nanmax, nanmean, nanmedian, min, percentile, prod, product, std, sum, var. Any options required by the operator can be passed to the options object.

In the example, a new column first_quantile is created based on values in the column my_col using the percentile operator with the q=0.25 parameter.

Example: {"first_quantile":{"column":"my_col","operator":"percentile","options":{"q":0.25}}}
column_fill_valuestring

Value to replace missing pivot columns names with.

columnsstring[]

Columns to group by on the table columns

drop_missing_columnsboolean

Do not include columns whose entries are all missing (default: true).

marginal_distribution_namestring

Name of marginal distribution row/column. (default: All)

marginal_distributionsboolean

Add totals for row/column. (default: false)

metric_fill_valuenumber

Value to replace missing values with in aggregate calculations.

ChartDataPivotOptionsSchema
{
"aggregates": {
"first_quantile": {
"column": "my_col",
"operator": "percentile",
"options": {
"q": 0.25
}
}
},
"column_fill_value": "string",
"columns": [
"string"
],
"drop_missing_columns": true,
"marginal_distribution_name": "string",
"marginal_distributions": true,
"metric_fill_value": 0
}