dfr var
for expression
Create a var expression for an aggregation
Signature
> dfr var {flags}
Input/output types:
input | output |
---|---|
any | any |
Examples
Var value from columns in a dataframe or aggregates columns to their var value
> [[a b]; [6 2] [4 2] [2 2]] | dfr into-df | dfr var
╭───┬──────┬──────╮
│ # │ a │ b │
├───┼──────┼──────┤
│ 0 │ 4.00 │ 0.00 │
╰───┴──────┴──────╯
Var aggregation for a group-by
> [[a b]; [one 2] [one 2] [two 1] [two 1]]
| dfr into-df
| dfr group-by a
| dfr agg (dfr col b | dfr var)
╭───┬─────┬──────╮
│ # │ a │ b │
├───┼─────┼──────┤
│ 0 │ one │ 0.00 │
│ 1 │ two │ 0.00 │
╰───┴─────┴──────╯
Tips: Dataframe commands were not shipped in the official binaries by default, you have to build it with --features=dataframe
flag