From 5d5bb6aea4fe14cd7b8a79bc298c19ceea582068 Mon Sep 17 00:00:00 2001 From: Alexander Beedie Date: Tue, 26 Sep 2023 13:37:06 +0400 Subject: [PATCH] docs(python): cross-reference `null_count` from `has_validity` (clarifies the correct way to check for nulls) (#11323) --- py-polars/polars/series/series.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/py-polars/polars/series/series.py b/py-polars/polars/series/series.py index 3279eb50c2bc..0e58ce5f15fd 100644 --- a/py-polars/polars/series/series.py +++ b/py-polars/polars/series/series.py @@ -3293,11 +3293,13 @@ def has_validity(self) -> bool: Notes ----- - While the _absence_ of a validity bitmask guarantees that a Series does not - have ``null`` values, the converse is not true, eg: the _presence_ of a - bitmask does not mean that there _are_ null values, as every value of the + While the *absence* of a validity bitmask guarantees that a Series does not + have ``null`` values, the converse is not true, eg: the *presence* of a + bitmask does not mean that there are null values, as every value of the bitmask could be ``false``. + To confirm that a column has ``null`` values use :func:`null_count`. + """ return self._s.has_validity()