From af5fa36d9e754cd233aedab8673bed8e85e6eef7 Mon Sep 17 00:00:00 2001 From: Abhijit Deo <72816663+abhi-glitchhg@users.noreply.github.com> Date: Fri, 20 Oct 2023 22:16:23 +0530 Subject: [PATCH] [Documentation] Added another example in `df.clip` documentation. (#55589) * Update generic.py * Update generic.py * Update generic.py --- pandas/core/generic.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 1ae4c3cdfc458..c525003cabd10 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -8785,6 +8785,16 @@ def clip( 3 -1 6 4 5 -4 + Clips using specific lower and upper thresholds per column: + + >>> df.clip([-2, -1], [4,5]) + col_0 col_1 + 0 4 -1 + 1 -2 -1 + 2 0 5 + 3 -1 5 + 4 4 -1 + Clips using specific lower and upper thresholds per column element: >>> t = pd.Series([2, -4, -1, 6, 3])