polars.LazyFrame.schema#

property LazyFrame.schema: Schema[source]#

Get an ordered mapping of column names to their data type.

Warning

Resolving the schema of a LazyFrame is a potentially expensive operation. Using collect_schema() is the idiomatic way to resolve the schema. This property exists only for symmetry with the DataFrame class.

See also

collect_schema
Schema

Examples

>>> lf = pl.LazyFrame(
...     {
...         "foo": [1, 2, 3],
...         "bar": [6.0, 7.0, 8.0],
...         "ham": ["a", "b", "c"],
...     }
... )
>>> lf.schema  
Schema({'foo': Int64, 'bar': Float64, 'ham': String})