Meta#
The following methods are available under the expr.meta attribute.
These operations allow you to modify the expressions or check for equality of the expressions themselves instead of answering questions on the data.
This can for instance be useful to create a set of unique expressions.
a1 = pl.col("a") a2 = pl.col("a") b1 = pl.col("b") + 1 b2 = pl.col("b") + 2 b3 = pl.col("b") + 2 # Create a set of meta expressions to deduplicate s = {e.meta for e in [a1, a2, b1, b2, b3]} assert len(s) == 3 # Turn back into expressions to get the final unique expressions unique_expressions = [e.as_expression() for e in s]
Return the original expression. |
|
|
Indicate if this expression is the same as another expression. |
Indicate if this expression expands into multiple expressions. |
|
Indicate if this expression is a basic (non-regex) unaliased column. |
|
|
Indicate if this expression only selects columns (optionally with aliasing). |
|
Indicate if this expression is a literal value (optionally aliased). |
Indicate if this expression expands to columns that match a regex pattern. |
|
|
Indicate if this expression is NOT the same as another expression. |
|
Get the column name that this expression would produce. |
|
Pop the latest expression and return the input(s) of the popped expression. |
Get a list with the root column name. |
|
|
Serialize this expression to a file or string in JSON format. |
|
Format the expression as a Graphviz graph. |
|
Format the expression as a tree. |
Undo any renaming operation like |
|
|
Write expression to json. |