polars.LazyFrame.columns#
- property LazyFrame.columns: list[str][source]#
Get the column names.
- Returns:
- list of str
A list containing the name of each column in order.
Warning
Determining the column names of a LazyFrame requires resolving its schema, which is a potentially expensive operation. Using
collect_schema()
is the idiomatic way of resolving the schema. This property exists only for symmetry with the DataFrame class.See also
collect_schema
Schema.names
Examples
>>> lf = pl.LazyFrame( ... { ... "foo": [1, 2, 3], ... "bar": [6, 7, 8], ... "ham": ["a", "b", "c"], ... } ... ).select("foo", "bar") >>> lf.columns ['foo', 'bar']