You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/07/23 01:43:41 UTC
[GitHub] [spark] ueshin commented on a change in pull request #33485: [SPARK-36261][PYTHON] Add remove_unused_categories to CategoricalAccessor and CategoricalIndex
ueshin commented on a change in pull request #33485:
URL: https://github.com/apache/spark/pull/33485#discussion_r675261177
##########
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:
Cool. Let me address it in a clean-up PR later. SPARK-36267
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org