polars.LazyFrame.width#

property LazyFrame.width: int[source]#

Get the number of columns.

Returns:
int

Warning

Determining the width of a LazyFrame requires resolving its schema. Resolving the schema of a LazyFrame can be an expensive operation. Avoid accessing this property repeatedly if possible.

Examples

>>> lf = pl.LazyFrame(
...     {
...         "foo": [1, 2, 3],
...         "bar": [4, 5, 6],
...     }
... )
>>> lf.width
2