@@ -5638,19 +5638,19 @@ def clip_upper(self, threshold, axis=None, inplace=False):
5638
5638
Return copy of the input with values above given value(s) truncated.
5639
5639
5640
5640
It truncates values above a certain threshold. Threshold can be a
5641
- single value or an array, in the latter case it performs the
5642
- truncation
5641
+ single value or an array, in the latter case it performs the truncation
5643
5642
element-wise.
5644
5643
5645
5644
Parameters
5646
5645
----------
5647
- threshold : float or array_like
5648
- Maximum value allowed. All values above threshold will be
5649
- set to this value.
5646
+ threshold : float or array-like
5647
+ Maximum value allowed. All values above threshold will be set to
5648
+ this value.
5650
5649
axis : int or string axis name, optional
5651
5650
Align object with threshold along the given axis.
5652
- inplace : boolean , default False
5651
+ inplace : bool , default False
5653
5652
Whether to perform the operation in place on the data.
5653
+ .. versionadded:: 0.21.0.
5654
5654
5655
5655
See Also
5656
5656
--------
@@ -5663,39 +5663,33 @@ def clip_upper(self, threshold, axis=None, inplace=False):
5663
5663
5664
5664
Examples
5665
5665
--------
5666
- >>> s = pd.Series([1,2,3,4,5,6,7 ])
5666
+ >>> s = pd.Series([1, 2, 3, 4, 5 ])
5667
5667
>>> s
5668
5668
0 1
5669
5669
1 2
5670
5670
2 3
5671
5671
3 4
5672
5672
4 5
5673
- 5 6
5674
- 6 7
5675
5673
dtype: int64
5676
5674
5677
- >>> s.clip_upper(4 )
5675
+ >>> s.clip_upper(3 )
5678
5676
0 1
5679
5677
1 2
5680
5678
2 3
5681
- 3 4
5682
- 4 4
5683
- 5 4
5684
- 6 4
5679
+ 3 3
5680
+ 4 3
5685
5681
dtype: int64
5686
5682
5687
- >>> t = [4,8,7,2,5,4,6 ]
5683
+ >>> t = [5, 4, 3, 2, 1 ]
5688
5684
>>> t
5689
- [4, 8, 7 , 2, 5, 4, 6 ]
5685
+ [5, 4, 3 , 2, 1 ]
5690
5686
5691
5687
>>> s.clip_upper(t)
5692
5688
0 1
5693
5689
1 2
5694
5690
2 3
5695
5691
3 2
5696
- 4 5
5697
- 5 4
5698
- 6 6
5692
+ 4 1
5699
5693
dtype: int64
5700
5694
"""
5701
5695
return self ._clip_with_one_bound (threshold , method = self .le ,
@@ -5719,7 +5713,7 @@ def clip_lower(self, threshold, axis=None, inplace=False):
5719
5713
5720
5714
See Also
5721
5715
--------
5722
- clip:
5716
+ clip : Return input copy with values below/above thresholds truncated.
5723
5717
5724
5718
Returns
5725
5719
-------
@@ -5903,6 +5897,7 @@ def at_time(self, time, asof=False):
5903
5897
Parameters
5904
5898
----------
5905
5899
time : datetime.time or string
5900
+ asof :
5906
5901
5907
5902
Returns
5908
5903
-------
0 commit comments