This used to be working until upgraded to latest Polars. The df
Dataframe has more than 2 columns, CP
and CP
are 2 of them. The intent here is to select column CK
and CP
for rows that are greater than value 0
.
let e11_filter = df
.lazy()
.filter(cols(["CK", "CP"]).gt(lit(0)))
.collect()?;
The error is as below.
Error: ComputeError(ErrString("The predicate passed to 'LazyFrame.filter' expanded to multiple expressions:
[(col(\"CK\")) > (0)],
[(col(\"CP\")) > (0)],
This is ambiguous. Try to combine the predicates with the 'all_exprs' or 'any_exprs' expression.
Error originated just after this operation:
DF [\"W\", \"Dataset\", \"MD\", \"CK\"]; PROJECT */8 COLUMNS; SELECTION: \"None\""))
I found similar question, but it is Python version.