如果你有一个值列表和一个带有一列文本的 Polars 数据框。你想过滤到只包含列表中项目的行,你会怎么写?
a_list = ['a', 'b', 'c' ]
df = pl.DataFrame( {'col1': ['I am just a string', 'one more, but without the letters', 'we want, a, b, c,', 'Nothing here']} )
我假设它有一些结合/使用
.is_in(a_list)
和.str.contains()
的东西,但我没能让它工作。