polars count
for dataframe
Returns the number of non-null values in the column.
This command requires a plugin
The polars count
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 count {flags}
Input/output types:
input | output |
---|---|
any | any |
Examples
Count the number of non-null values in a column
> [[a]; ["foo"] ["bar"] [null]] | polars into-df
| polars select (polars col a | polars count)
| polars collect
╭───┬───╮
│ # │ a │
├───┼───┤
│ 0 │ 2 │
╰───┴───╯