polars len
for dataframe
Return the number of rows in the context. This is similar to COUNT(*) in SQL.
This command requires a plugin
The polars len
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 len {flags}
Input/output types:
input | output |
---|---|
any | any |
Examples
Count the number of rows in the the dataframe.
> [[a b]; [1 2] [3 4]] | polars into-df | polars select (polars len) | polars collect
╭───┬─────╮
│ # │ len │
├───┼─────┤
│ 0 │ 2 │
╰───┴─────╯
Creates a last expression from a column
> polars col a | polars last