2022-02-14 03:22:51 +01:00
|
|
|
---
|
|
|
|
title: dfr pivot
|
|
|
|
layout: command
|
2022-03-04 13:10:09 +01:00
|
|
|
version: 0.59.1
|
2022-02-14 03:22:51 +01:00
|
|
|
---
|
|
|
|
|
|
|
|
Performs a pivot operation on a groupby object
|
|
|
|
|
|
|
|
## Signature
|
|
|
|
|
2022-02-20 02:13:33 +01:00
|
|
|
```> dfr pivot (pivot_column) (value_column) (operation)```
|
2022-02-14 03:22:51 +01:00
|
|
|
|
|
|
|
## Parameters
|
|
|
|
|
2022-02-20 02:13:33 +01:00
|
|
|
- `pivot_column`: pivot column to perform pivot
|
|
|
|
- `value_column`: value column to perform pivot
|
2022-02-14 03:22:51 +01:00
|
|
|
- `operation`: aggregate operation
|
|
|
|
|
|
|
|
## Examples
|
|
|
|
|
|
|
|
Pivot a dataframe on b and aggregation on col c
|
|
|
|
```shell
|
|
|
|
> [[a b c]; [one x 1] [two y 2]] | dfr to-df | dfr group-by a | dfr pivot b c sum
|
|
|
|
```
|