Suppose I have a polars expression in python. Is there a straightforward way to get information about it? For example, if an expression is an alias, how might I get the name?
import polars as pl
pl.col("mpg").alias("mpg2")
I've looked through the different methods both on polars Expr and PyExpr classes, but had trouble finding anything that returned information about an expression.
Polars expression have a meta namespace that allows you to get meta information about expressions.
>>> pl.col("mpg").alias("mpg2").meta.output_name()
'mpg2'
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With