From 96270919fac9c000f4e6045f08380b87ca6f7cb2 Mon Sep 17 00:00:00 2001 From: brandon-b-miller <53796099+brandon-b-miller@users.noreply.github.com> Date: Fri, 15 Jul 2022 17:47:38 -0500 Subject: [PATCH] Note null behavior in `where` docs (#11276) Closes https://github.com/rapidsai/cudf/issues/9328 Authors: - https://github.com/brandon-b-miller Approvers: - Vyas Ramasubramani (https://github.com/vyasr) URL: https://github.com/rapidsai/cudf/pull/11276 --- python/cudf/cudf/core/frame.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/python/cudf/cudf/core/frame.py b/python/cudf/cudf/core/frame.py index c58e2adfe41..2789590c8fc 100644 --- a/python/cudf/cudf/core/frame.py +++ b/python/cudf/cudf/core/frame.py @@ -613,6 +613,22 @@ def where(self, cond, other=None, inplace=False): 3 4 dtype: int64 + + .. pandas-compat:: + Note that ``where`` treats missing values as falsy, + in parallel with pandas treatment of nullable data: + + >>> gsr = cudf.Series([1, 2, 3]) + >>> gsr.where([True, False, cudf.NA]) + 0 1 + 1 + 2 + dtype: int64 + >>> gsr.where([True, False, False]) + 0 1 + 1 + 2 + dtype: int64 """ raise NotImplementedError