Skip to content

Commit fbec88c

Browse files
authored
DOC: mention both mirror methods (#57009)
mention both mirror methods
1 parent 26256d5 commit fbec88c

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

pandas/core/generic.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10858,25 +10858,28 @@ def where(
1085810858
1085910859
Returns
1086010860
-------
10861-
Same type as caller or None if ``inplace=True``.
10861+
Series or DataFrame unless ``inplace=True`` in which case
10862+
returns None.
1086210863
1086310864
See Also
1086410865
--------
1086510866
:func:`DataFrame.{name_other}` : Return an object of same shape as
10866-
self.
10867+
caller.
10868+
:func:`Series.{name_other}` : Return an object of same shape as
10869+
caller.
1086710870
1086810871
Notes
1086910872
-----
1087010873
The {name} method is an application of the if-then idiom. For each
10871-
element in the calling DataFrame, if ``cond`` is ``{cond}`` the
10872-
element is used; otherwise the corresponding element from the DataFrame
10874+
element in the caller, if ``cond`` is ``{cond}`` the
10875+
element is used; otherwise the corresponding element from
1087310876
``other`` is used. If the axis of ``other`` does not align with axis of
1087410877
``cond`` {klass}, the values of ``cond`` on misaligned index positions
1087510878
will be filled with {cond_rev}.
1087610879
10877-
The signature for :func:`DataFrame.where` differs from
10878-
:func:`numpy.where`. Roughly ``df1.where(m, df2)`` is equivalent to
10879-
``np.where(m, df1, df2)``.
10880+
The signature for :func:`Series.where` or
10881+
:func:`DataFrame.where` differs from :func:`numpy.where`.
10882+
Roughly ``df1.where(m, df2)`` is equivalent to ``np.where(m, df1, df2)``.
1088010883
1088110884
For further details and examples see the ``{name}`` documentation in
1088210885
:ref:`indexing <indexing.where_mask>`.

0 commit comments

Comments
 (0)