dfr unique for dataframe or lazyframe

Returns unique values from a dataframe.

Signature

> dfr unique --subset --last --maintain-order

Parameters

  • --subset {any}: Subset of column(s) to use to maintain rows (lazy df)
  • --last (-l): Keeps last unique value. Default keeps first value (lazy df)
  • --maintain-order (-k): Keep the same order as the original DataFrame (lazy df)

Input/output types:

inputoutput
anyany

Examples

Returns unique values from a series

> [2 2 2 2 2] | dfr into-df | dfr unique
╭───┬───╮
│ # │ 0 │
├───┼───┤
│ 02 │
╰───┴───╯

Creates a is unique expression from a column

> col a | unique

Tips: Dataframe commands were not shipped in the official binaries by default, you have to build it with --features=dataframe flag