itholic commented on code in PR #36041:
URL: https://github.com/apache/spark/pull/36041#discussion_r842234275
##########
python/pyspark/pandas/series.py:
##########
@@ -2154,6 +2159,8 @@ def clip(self, lower: Union[float, int] = None, upper:
Union[float, int] = None)
Minimum threshold value. All values below this threshold will be
set to it.
upper : float or int, default None
Maximum threshold value. All values above this threshold will be
set to it.
+ inplace : bool, default False
+ if True, perform operation in-place
Review Comment:
Maybe do we also might need to `*args` and `**kwargs` for compatibility with
pandas ?
<img width="604" alt="Screen Shot 2022-04-05 at 9 16 56 AM"
src="https://user-images.githubusercontent.com/44108233/161654114-fb4264c1-a6ce-4eaf-8853-b2cb3a20d31d.png">
##########
python/pyspark/pandas/series.py:
##########
@@ -2162,12 +2169,26 @@ def clip(self, lower: Union[float, int] = None, upper:
Union[float, int] = None)
Examples
--------
- >>> ps.Series([0, 2, 4]).clip(1, 3)
+ >>> psser = ps.Series([0, 2, 4])
+ >>> psser
+ 0 0
+ 1 2
+ 2 4
+ dtype: int64
+
+ >>> psser.clip(1, 3)
0 1
1 2
2 3
dtype: int64
Review Comment:
nit: how about add short description for the command below?
e.g. `Clip also can be performed in-place`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]