polars arg-unique for dataframe
Returns indexes for unique values.
This command requires a plugin
The polars arg-unique command resides in the polars plugin. To use this command, you must install and register nu_plugin_polars. See the Plugins chapter in the book for more information.
Signature
> polars arg-unique {flags}
Input/output types:
| input | output |
|---|---|
| polars_dataframe | polars_dataframe |
| polars_lazyframe | polars_lazyframe |
Examples
Returns indexes for unique values
> [1 2 2 3 3] | polars into-df | polars arg-unique
╭───┬────────────╮
│ # │ arg_unique │
├───┼────────────┤
│ 0 │ 0 │
│ 1 │ 1 │
│ 2 │ 3 │
╰───┴────────────╯