diff --git a/py-polars/polars/dataframe/groupby.py b/py-polars/polars/dataframe/groupby.py index ac92466d3038..6f5dea8838b0 100644 --- a/py-polars/polars/dataframe/groupby.py +++ b/py-polars/polars/dataframe/groupby.py @@ -452,6 +452,9 @@ def count(self) -> DF: """ Count the number of values in each group. + .. warning:: + `null` is deemed a value in this context. + Examples -------- >>> df = pl.DataFrame( diff --git a/py-polars/polars/expr/expr.py b/py-polars/polars/expr/expr.py index 9e6cc68f956e..fbb3f8382d54 100644 --- a/py-polars/polars/expr/expr.py +++ b/py-polars/polars/expr/expr.py @@ -1124,6 +1124,9 @@ def count(self) -> Self: """ Count the number of values in this expression. + .. warning:: + `null` is deemed a value in this context. + Examples -------- >>> df = pl.DataFrame({"a": [8, 9, 10], "b": [None, 4, 4]}) diff --git a/py-polars/polars/functions/lazy.py b/py-polars/polars/functions/lazy.py index 1058a6e4ccff..e6688e9594ed 100644 --- a/py-polars/polars/functions/lazy.py +++ b/py-polars/polars/functions/lazy.py @@ -291,6 +291,9 @@ def count(column: str | Series | None = None) -> Expr | int: """ Count the number of values in this column/context. + .. warning:: + `null` is deemed a value in this context. + Parameters ---------- column diff --git a/py-polars/polars/lazyframe/groupby.py b/py-polars/polars/lazyframe/groupby.py index 03fd999c01ad..a824bb30a846 100644 --- a/py-polars/polars/lazyframe/groupby.py +++ b/py-polars/polars/lazyframe/groupby.py @@ -346,6 +346,9 @@ def count(self) -> LDF: """ Count the number of values in each group. + .. warning:: + `null` is deemed a value in this context. + Examples -------- >>> ldf = pl.DataFrame(