df = pl.DataFrame({ 'doc_n': ['1111', '2222', '3333'], 'received': ['qty', '6.0', None], }) 当我尝试过滤它时,我只收到了“2222”行,Polars 也删除了“null”行。但我需要把它留在我的 df 中 ''' df = df.filter(pl.col('收到') != '数量') ''' 如何正确过滤?过滤器之...
So the right way is given index, fetch the right field and then use its name to fetch the data in the expression level? Yes, but we already have that logic, it seems that we don't hit that in thefilter Note thatselectworks as expected: df=pl.DataFrame({"foo": [{"a":1},{"a"...
https://docs.pola.rs/api/python/stable/reference/series/api/polars.series.search_sorted.html search_sorted 答案是: import polars as pl df = pl.DataFrame( { "a": [1, 2, 3], "b": [6.0, 5.0, 4.0], "c": ["z", "x", "y"], } ) def filter_sort_explicit(df, c, l): "...