我有一行代码在 polars 中,在我最近更新 polars 包到 '0.19.0' 之前是可以工作的。这个例子之前运行过:
import polars as pl
df = pl.DataFrame(
{
"a": [5, 6, 7, 8, 9],
"b": [5, 6, 7, 8, 9],
"c": [5, 6, 7, 8, None],})
cols_1 = ["a", "b"]
cols_2 = ["c"]
df = df.filter(pl.all(pl.col(cols_1 + cols_2).is_not_null()))
但现在出现了错误:
ValueError: could not convert value 'Unknown' as a Literal
pl.all_horizontal()
来修复它。 - undefinedDeprecationWarning: 使用
all进行水平计算已被弃用。请改用
all_horizontal。
它在0.19.0版本中被移除。 - undefined