polars.LazyFrame.schema#

property LazyFrame.schema: OrderedDict[str, DataType][source]#

Get a mapping of column names to their data type.

Returns:
OrderedDict

An ordered mapping of column names to their data type.

Warning

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.0, 7.0, 8.0],
...         "ham": ["a", "b", "c"],
...     }
... )
>>> lf.schema
OrderedDict({'foo': Int64, 'bar': Float64, 'ham': String})