You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't understand some behavior of & to intersect selectors and expressions.
In the example above, cs.by_name("a") | pl.col("b") returns both columns, which makes sense since both match the condition that they are either "a" or "b". My issue is that cs.by_name("a") & pl.col("b") also returns both columns, but IMO it shouldn't since none of the columns is "a" and "b" at the same time. This comes from this if condition:
Checks
Reproducible example
Log output
No response
Issue description
I don't understand some behavior of
&
to intersect selectors and expressions.In the example above,
cs.by_name("a") | pl.col("b")
returns both columns, which makes sense since both match the condition that they are either "a" or "b". My issue is thatcs.by_name("a") & pl.col("b")
also returns both columns, but IMO it shouldn't since none of the columns is "a" and "b" at the same time. This comes from thisif
condition:polars/py-polars/polars/selectors.py
Lines 386 to 392 in 7f0b3e0
I understand there are some issues with selectors, e.g. #13757. Is this also an issue or am I misunderstanding?
Expected behavior
df.select(cs.by_name("a") & pl.col("b"))
should return 0 cols.Installed versions
The text was updated successfully, but these errors were encountered: