@@ -6547,32 +6547,46 @@ def clip(self, lower=None, upper=None, axis=None, inplace=False,
6547
6547
6548
6548
def clip_upper (self , threshold , axis = None , inplace = False ):
6549
6549
"""
6550
- Return copy of the input with values above given value(s) truncated .
6550
+ Trim values above a given threshold .
6551
6551
6552
- It truncates values above a certain threshold. Threshold can be a
6553
- single value or an array, in the latter case it performs the truncation
6554
- element-wise.
6552
+ Elements above the ` threshold` will be changed to match the
6553
+ `threshold` value(s). Threshold can be a single value or an array,
6554
+ in the latter case it performs the truncation element-wise.
6555
6555
6556
6556
Parameters
6557
6557
----------
6558
- threshold : float or array-like
6558
+ threshold : numeric or array-like
6559
6559
Maximum value allowed. All values above threshold will be set to
6560
6560
this value.
6561
- axis : int or string axis name, optional
6562
- Align object with threshold along the given axis.
6561
+
6562
+ * float : every value is compared to `threshold`.
6563
+ * array-like : The shape of `threshold` should match the object
6564
+ it's compared to. When `self` is a Series, `threshold` should be
6565
+ the length. When `self` is a DataFrame, `threshold` should 2-D
6566
+ and the same shape as `self` for ``axis=None``, or 1-D and the
6567
+ same length as the axis being compared.
6568
+
6569
+ axis : {0 or 'index', 1 or 'columns'}, default 0
6570
+ Align object with `threshold` along the given axis.
6563
6571
inplace : boolean, default False
6564
6572
Whether to perform the operation in place on the data.
6565
6573
6566
6574
.. versionadded:: 0.21.0
6567
6575
6568
- See Also
6569
- --------
6570
- clip : Return input copy with values below/above thresholds truncated.
6571
- clip_lower : Method to truncate values below given thresholds.
6572
-
6573
6576
Returns
6574
6577
-------
6575
- clipped : same type as input
6578
+ clipped
6579
+ Original data with values trimmed.
6580
+
6581
+ See Also
6582
+ --------
6583
+ DataFrame.clip : General purpose method to trim DataFrame values to
6584
+ given threshold(s)
6585
+ DataFrame.clip_lower : Trim DataFrame values below given
6586
+ threshold(s)
6587
+ Series.clip : General purpose method to trim Series values to given
6588
+ threshold(s)
6589
+ Series.clip_lower : Trim Series values below given threshold(s)
6576
6590
6577
6591
Examples
6578
6592
--------
@@ -6613,7 +6627,8 @@ def clip_lower(self, threshold, axis=None, inplace=False):
6613
6627
Trim values below a given threshold.
6614
6628
6615
6629
Elements below the `threshold` will be changed to match the
6616
- `threshold` value(s).
6630
+ `threshold` value(s). Threshold can be a single value or an array,
6631
+ in the latter case it performs the truncation element-wise.
6617
6632
6618
6633
Parameters
6619
6634
----------
@@ -6636,20 +6651,20 @@ def clip_lower(self, threshold, axis=None, inplace=False):
6636
6651
6637
6652
.. versionadded:: 0.21.0
6638
6653
6654
+ Returns
6655
+ -------
6656
+ clipped
6657
+ Original data with values trimmed.
6658
+
6639
6659
See Also
6640
6660
--------
6641
- DataFrame.clip : General purpose method to trim ` DataFrame` values to
6661
+ DataFrame.clip : General purpose method to trim DataFrame values to
6642
6662
given threshold(s)
6643
- DataFrame.clip_upper : Trim ` DataFrame` values above given
6663
+ DataFrame.clip_upper : Trim DataFrame values above given
6644
6664
threshold(s)
6645
- Series.clip : General purpose method to trim ` Series` values to given
6665
+ Series.clip : General purpose method to trim Series values to given
6646
6666
threshold(s)
6647
- Series.clip_upper : Trim `Series` values above given threshold(s)
6648
-
6649
- Returns
6650
- -------
6651
- clipped
6652
- Original data with values trimmed.
6667
+ Series.clip_upper : Trim Series values above given threshold(s)
6653
6668
6654
6669
Examples
6655
6670
--------
@@ -6716,7 +6731,6 @@ def clip_lower(self, threshold, axis=None, inplace=False):
6716
6731
0 4 5
6717
6732
1 4 5
6718
6733
2 5 6
6719
-
6720
6734
"""
6721
6735
return self ._clip_with_one_bound (threshold , method = self .ge ,
6722
6736
axis = axis , inplace = inplace )
0 commit comments