polars n-unique

For dataframe.

Counts unique values.

warning This command requires a plugin The polars n-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.

Command Type

plugin

Signature

> polars n-unique {flags}

Input/output types:

input output
polars_expression polars_expression
polars_selector polars_expression
polars_dataframe polars_dataframe
polars_lazyframe polars_lazyframe

Examples

Counts unique values

> [1 1 2 2 3 3 4] | polars into-df | polars n-unique
╭───┬──────────────╮
│ # │ count_unique │
├───┼──────────────┤
│ 0 │            4 │
╰───┴──────────────╯

Creates a is n-unique expression from a column

> polars col a | polars n-unique

Ported from nushell/nushell.github.io. Copyright (c) 2021 Nushell Project. MIT License.