polars len

For dataframe.

Return the number of rows in the context. This is similar to COUNT(*) in SQL.

warning 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.

Command Type

plugin

Signature

> polars len {flags}

Input/output types:

input output
any polars_expression

Examples

Count the number of rows in 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

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