Skip to content

Commit 04e8898

Browse files
authored
DOC: Group relevant df.mask/df.where examples together (#37032)
- Close #25187
1 parent e8fca9e commit 04e8898

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pandas/core/generic.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -9095,7 +9095,6 @@ def where(
90959095
3 3.0
90969096
4 4.0
90979097
dtype: float64
9098-
90999098
>>> s.mask(s > 0)
91009099
0 0.0
91019100
1 NaN
@@ -9111,6 +9110,13 @@ def where(
91119110
3 3
91129111
4 4
91139112
dtype: int64
9113+
>>> s.mask(s > 1, 10)
9114+
0 0
9115+
1 1
9116+
2 10
9117+
3 10
9118+
4 10
9119+
dtype: int64
91149120
91159121
>>> df = pd.DataFrame(np.arange(10).reshape(-1, 2), columns=['A', 'B'])
91169122
>>> df

0 commit comments

Comments
 (0)