diff --git a/pandas/core/generic.py b/pandas/core/generic.py index a75e3960cda16..920b0f5ae7b51 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -6572,7 +6572,10 @@ def clip_upper(self, threshold, axis=None, inplace=False): def clip_lower(self, threshold, axis=None, inplace=False): """ - Return copy of the input with values below a threshold truncated. + Trim values below a given threshold. + + Elements below the `threshold` will be changed to match the + `threshold` value(s). Parameters ---------- @@ -6597,17 +6600,22 @@ def clip_lower(self, threshold, axis=None, inplace=False): See Also -------- - Series.clip : Return copy of input with values below and above - thresholds truncated. - Series.clip_upper : Return copy of input with values above - threshold truncated. + DataFrame.clip : General purpose method to trim `DataFrame` values to + given threshold(s) + DataFrame.clip_upper : Trim `DataFrame` values above given + threshold(s) + Series.clip : General purpose method to trim `Series` values to given + threshold(s) + Series.clip_upper : Trim `Series` values above given threshold(s) Returns ------- - clipped : same type as input + clipped + Original data with values trimmed. Examples -------- + Series single threshold clipping: >>> s = pd.Series([5, 6, 7, 8, 9]) @@ -6659,17 +6667,18 @@ def clip_lower(self, threshold, axis=None, inplace=False): `threshold` should be the same length as the axis specified by `axis`. - >>> df.clip_lower(np.array([3, 3, 5]), axis='index') + >>> df.clip_lower([3, 3, 5], axis='index') A B 0 3 3 1 3 4 2 5 6 - >>> df.clip_lower(np.array([4, 5]), axis='columns') + >>> df.clip_lower([4, 5], axis='columns') A B 0 4 5 1 4 5 2 5 6 + """ return self._clip_with_one_bound(threshold, method=self.ge, axis=axis, inplace=inplace)