Skip to main content
Version: Next

ChartDataSortOptionsSchema

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}}}
columnsobjectrequired

columns by by which to sort. The key specifies the column name, value specifies if sorting in ascending order.

Example: {"country":true,"gender":false}
ChartDataSortOptionsSchema
{
"aggregates": {
"first_quantile": {
"column": "my_col",
"operator": "percentile",
"options": {
"q": 0.25
}
}
},
"columns": {
"country": true,
"gender": false
}
}