diff --git a/py-polars/polars/dataframe/frame.py b/py-polars/polars/dataframe/frame.py index a5295cf61920..cefa6c909b92 100644 --- a/py-polars/polars/dataframe/frame.py +++ b/py-polars/polars/dataframe/frame.py @@ -4181,6 +4181,8 @@ def filter( The original order of the remaining rows is preserved. + Rows where the filter does not evaluate to True are discarded, including nulls. + Parameters ---------- predicates diff --git a/py-polars/polars/expr/expr.py b/py-polars/polars/expr/expr.py index aaf57bf9210f..94dc014bede4 100644 --- a/py-polars/polars/expr/expr.py +++ b/py-polars/polars/expr/expr.py @@ -4560,6 +4560,9 @@ def filter( The original order of the remaining elements is preserved. + Elements where the filter does not evaluate to True are discarded, including + nulls. + Mostly useful in an aggregation context. If you want to filter on a DataFrame level, use `LazyFrame.filter`. diff --git a/py-polars/polars/lazyframe/frame.py b/py-polars/polars/lazyframe/frame.py index 68bf98379a68..a176cc1b3324 100644 --- a/py-polars/polars/lazyframe/frame.py +++ b/py-polars/polars/lazyframe/frame.py @@ -2865,6 +2865,8 @@ def filter( The original order of the remaining rows is preserved. + Rows where the filter does not evaluate to True are discarded, including nulls. + Parameters ---------- predicates diff --git a/py-polars/polars/series/series.py b/py-polars/polars/series/series.py index 4f7c5e58fa6d..d5d777549643 100644 --- a/py-polars/polars/series/series.py +++ b/py-polars/polars/series/series.py @@ -3177,6 +3177,9 @@ def filter(self, predicate: Series | list[bool]) -> Self: The original order of the remaining elements is preserved. + Elements where the filter does not evaluate to True are discarded, including + nulls. + Parameters ---------- predicate