2022-02-14 03:22:51 +01:00
|
|
|
---
|
|
|
|
title: dfr aggregate
|
|
|
|
layout: command
|
2022-03-04 13:10:09 +01:00
|
|
|
version: 0.59.1
|
2022-02-14 03:22:51 +01:00
|
|
|
---
|
|
|
|
|
|
|
|
Performs an aggregation operation on a dataframe and groupby object
|
|
|
|
|
|
|
|
## Signature
|
|
|
|
|
2022-02-20 02:13:33 +01:00
|
|
|
```> dfr aggregate (operation_name) --quantile --explicit```
|
2022-02-14 03:22:51 +01:00
|
|
|
|
|
|
|
## Parameters
|
|
|
|
|
2022-02-22 14:11:46 +01:00
|
|
|
- `operation_name`:
|
2022-02-14 03:22:51 +01:00
|
|
|
Dataframes: mean, sum, min, max, quantile, median, var, std
|
|
|
|
GroupBy: mean, sum, min, max, first, last, nunique, quantile, median, var, std, count
|
|
|
|
- `--quantile {number}`: quantile value for quantile operation
|
|
|
|
- `--explicit`: returns explicit names for groupby aggregations
|
|
|
|
|
|
|
|
## Examples
|
|
|
|
|
|
|
|
Aggregate sum by grouping by column a and summing on col b
|
|
|
|
```shell
|
|
|
|
> [[a b]; [one 1] [one 2]] | dfr to-df | dfr group-by a | dfr aggregate sum
|
|
|
|
```
|
|
|
|
|
|
|
|
Aggregate sum in dataframe columns
|
|
|
|
```shell
|
|
|
|
> [[a b]; [4 1] [5 2]] | dfr to-df | dfr aggregate sum
|
|
|
|
```
|
|
|
|
|
|
|
|
Aggregate sum in series
|
|
|
|
```shell
|
|
|
|
> [4 1 5 6] | dfr to-df | dfr aggregate sum
|
|
|
|
```
|