Skip to content

Commit af5fa36

Browse files
[Documentation] Added another example in df.clip documentation. (pandas-dev#55589)
* Update generic.py * Update generic.py * Update generic.py
1 parent 52cdc34 commit af5fa36

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pandas/core/generic.py

+10
Original file line numberDiff line numberDiff line change
@@ -8785,6 +8785,16 @@ def clip(
87858785
3 -1 6
87868786
4 5 -4
87878787
8788+
Clips using specific lower and upper thresholds per column:
8789+
8790+
>>> df.clip([-2, -1], [4,5])
8791+
col_0 col_1
8792+
0 4 -1
8793+
1 -2 -1
8794+
2 0 5
8795+
3 -1 5
8796+
4 4 -1
8797+
87888798
Clips using specific lower and upper thresholds per column element:
87898799
87908800
>>> t = pd.Series([2, -4, -1, 6, 3])

0 commit comments

Comments
 (0)