Skip to content

Commit 62002ff

Browse files
authored
Merge pull request #1 from abhaypsingh/abhaypsingh-patch-1
DOC: Fix mask/where docstring to align with self and cond (#61781)
2 parents 9ff14a3 + 7fadde0 commit 62002ff

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

pandas/core/generic.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
Timestamp,
3434
to_offset,
3535
)
36+
3637
from pandas._typing import (
3738
AlignJoin,
3839
AnyArrayLike,
@@ -67,7 +68,8 @@
6768
Renamer,
6869
Scalar,
6970
Self,
70-
SequenceNotStr,
71+
72+
SequenceNotStr,
7173
SortKind,
7274
StorageOptions,
7375
Suffixes,
@@ -9946,7 +9948,7 @@ def where(
99469948
The {name} method is an application of the if-then idiom. For each
99479949
element in the caller, if ``cond`` is ``{cond}`` the
99489950
element is used; otherwise the corresponding element from
9949-
``other`` is used. If the axis of ``other`` does not align with axis of
9951+
``other`` is used. If the axis of ``other`` does not align with axis of
99509952
``cond`` {klass}, the values of ``cond`` on misaligned index positions
99519953
will be filled with {cond_rev}.
99529954
@@ -9982,6 +9984,7 @@ def where(
99829984
>>> t = pd.Series([True, False])
99839985
>>> s.where(t, 99)
99849986
0 0
9987+
99859988
1 99
99869989
2 99
99879990
3 99
@@ -10017,7 +10020,8 @@ def where(
1001710020
1 2 3
1001810021
2 4 5
1001910022
3 6 7
10020-
4 8 9
10023+
4
10024+
8 9
1002110025
>>> m = df % 3 == 0
1002210026
>>> df.where(m, -df)
1002310027
A B

0 commit comments

Comments
 (0)