Spec-Zone.ru › Polars

polars.DataFrame.lazy

DataFrame.lazy() → LazyFrame

Start a lazy query from this point. This returns a LazyFrame object.

Operations on a LazyFrame are not executed until this is triggered by calling one of:

  • .collect()

    (run on all data)

  • .explain()

    (print the query plan)

  • .show_graph()

    (show the query plan as graphviz graph)

  • .collect_schema()

    (return the final frame schema)

Lazy operations are recommended because they allow for query optimization and additional parallelism.

Returns:
LazyFrame

Examples

>>> df = pl.DataFrame(
...     {
...         "a": [None, 2, 3, 4],
...         "b": [0.5, None, 2.5, 13],
...         "c": [True, True, False, None],
...     }
... )
>>> df.lazy()
<LazyFrame at ...>

© 2020 Ritchie Vink
© 2022 Polars contributors
Licensed under the MIT License.
https://docs.pola.rs/api/python/stable/reference/dataframe/api/polars.DataFrame.lazy.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API