From 24fda6f041f6dda18be9cdf40ea6d78b56037a39 Mon Sep 17 00:00:00 2001 From: Abhay Singh Date: Sat, 2 Aug 2025 18:27:08 -0500 Subject: [PATCH] DOC: fix mask/where docstring alignment note (#61781) The explanatory paragraph wrongly said that alignment is between `other` and `cond`. It is between *self* and `cond`; values fall back to *self* for mis-aligned positions. Update both generic docstring templates so all Series/DataFrame variants inherit the correct wording. Closes #61781 Signed-off-by: Abhay Singh --- pandas/core/generic.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index cbd853886a0f4..fc12dab7edce7 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -9946,9 +9946,9 @@ def where( The {name} method is an application of the if-then idiom. For each element in the caller, if ``cond`` is ``{cond}`` the element is used; otherwise the corresponding element from - ``other`` is used. If the axis of ``other`` does not align with axis of - ``cond`` {klass}, the values of ``cond`` on misaligned index positions - will be filled with {cond_rev}. + ``other`` is used. If the axis of ``self`` does not align with axis of + ``cond``, misaligned index positions will be filled with the original value + from ``self``. The signature for :func:`Series.where` or :func:`DataFrame.where` differs from :func:`numpy.where`.