W3cubDocs

/Nushell

dfr unique for dataframe or lazyframe

Returns unique values from a dataframe.

Signature

> dfr unique {flags}

Flags

  • --subset, -s {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:

input output
any any

Examples

Returns unique values from a series

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

Creates a is unique expression from a column

>cola|unique

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

Copyright © 2019–2023 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/dfr_unique.html