itholic commented on a change in pull request #33485:
URL: https://github.com/apache/spark/pull/33485#discussion_r675247188
##########
File path: python/pyspark/pandas/categorical.py
##########
@@ -439,8 +439,47 @@ def remove_categories(
else:
return psser
- def remove_unused_categories(self) -> "ps.Series":
- raise NotImplementedError()
+ def remove_unused_categories(self, inplace: bool = False) ->
Optional["ps.Series"]:
+ """
+ Remove categories which are not used.
+
+ Parameters
+ ----------
+ inplace : bool, default False
+ Whether or not to drop unused categories inplace or return a copy of
+ this categorical with unused categories dropped.
Review comment:
Btw, pandas deprecate `inplace` parameter since 1.2.0.
<img width="819" alt="Screen Shot 2021-07-23 at 9 45 44 AM"
src="https://user-images.githubusercontent.com/44108233/126725825-da676086-e1e5-44dc-a84d-98adda35f8c3.png">
Should we also raise the deprecation warning ??
--
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]