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. 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": [6, 7, 8], ... "ham": ["a", "b", "c"], ... } ... ).select("foo", "bar") >>> lf.columns ['foo', 'bar']