polars.Expr.meta.tree_format#

Expr.meta.tree_format(*, return_as_string: bool = False) str | None[source]#

Format the expression as a tree.

Parameters:
return_as_string:

If True, return as string rather than printing to stdout.

Examples

>>> e = (pl.col("foo") * pl.col("bar")).sum().over(pl.col("ham")) / 2
>>> e.meta.tree_format(return_as_string=True)