Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the other in L9949 i agree should be self. the rest of this i think is OK as it means that cond is reindexed with cond_rev as its fill_value.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(actually passing fill_value to align might be better than the current implementation that separately calls fillna after align.

``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`.
Expand Down
Loading