Open shenker opened 8 months ago
For completeness, this is in general and not only for categorical types. Currently, list vs list is not yet supported
s=pl.Series([[1,2],[2,3]])
s2=pl.Series([[2,3],[4,3]])
s.is_in(s2)
# polars.exceptions.InvalidOperationError: `is_in` operation not supported for dtype `list[i64]`
Any suggested workarounds?
I think Expr.list.set_intersection()
should have the desired effect.
https://docs.pola.rs/api/python/dev/reference/expressions/api/polars.Expr.list.set_intersection.html
Description
is_in
was recently fixed for String-Categorical/Enum comparisons (https://github.com/pola-rs/polars/issues/14575) andlist.contains
was recently fixed for List(Categorical/Enum)-Categorical/Enum comparisons (https://github.com/pola-rs/polars/issues/14559), but List(Categorical)-List(Categorical) comparisons still need to be fixed foris_in
.