diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 4bea3a462db07..828d4705a4856 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -138,14 +138,11 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.RangeIndex.start SA01" \ -i "pandas.RangeIndex.step SA01" \ -i "pandas.RangeIndex.stop SA01" \ - -i "pandas.Series.cat.add_categories PR01,PR02" \ - -i "pandas.Series.cat.as_ordered PR01" \ - -i "pandas.Series.cat.as_unordered PR01" \ - -i "pandas.Series.cat.remove_categories PR01,PR02" \ - -i "pandas.Series.cat.remove_unused_categories PR01" \ - -i "pandas.Series.cat.rename_categories PR01,PR02" \ - -i "pandas.Series.cat.reorder_categories PR01,PR02" \ - -i "pandas.Series.cat.set_categories PR01,PR02" \ + -i "pandas.Series.cat.add_categories PR02" \ + -i "pandas.Series.cat.remove_categories PR02" \ + -i "pandas.Series.cat.rename_categories PR02" \ + -i "pandas.Series.cat.reorder_categories PR02" \ + -i "pandas.Series.cat.set_categories PR02" \ -i "pandas.Series.dt.as_unit PR01,PR02" \ -i "pandas.Series.dt.ceil PR01,PR02" \ -i "pandas.Series.dt.components SA01" \ diff --git a/pandas/core/arrays/categorical.py b/pandas/core/arrays/categorical.py index 64e5eec43a5c1..4be461b3ec841 100644 --- a/pandas/core/arrays/categorical.py +++ b/pandas/core/arrays/categorical.py @@ -975,6 +975,12 @@ def as_ordered(self) -> Self: """ Set the Categorical to be ordered. + Parameters + ---------- + *args, **kwargs : optional + Additional keywords have no effect but might be accepted for + compatibility with NumPy. + Returns ------- Categorical @@ -1010,6 +1016,12 @@ def as_unordered(self) -> Self: """ Set the Categorical to be unordered. + Parameters + ---------- + *args, **kwargs : optional + Additional keywords have no effect but might be accepted for + compatibility with NumPy. + Returns ------- Categorical @@ -1074,6 +1086,9 @@ def set_categories( rename : bool, default False Whether or not the new_categories should be considered as a rename of the old categories or as reordered categories. + *args, **kwargs : optional + Additional keywords have no effect but might be accepted for + compatibility with NumPy. Returns ------- @@ -1173,6 +1188,9 @@ def rename_categories(self, new_categories) -> Self: * callable : a callable that is called on all items in the old categories and whose return values comprise the new categories. + *args, **kwargs : optional + Additional keywords have no effect but might be accepted for + compatibility with NumPy. Returns ------- @@ -1239,6 +1257,9 @@ def reorder_categories(self, new_categories, ordered=None) -> Self: ordered : bool, optional Whether or not the categorical is treated as a ordered categorical. If not given, do not change the ordered information. + *args, **kwargs : optional + Additional keywords have no effect but might be accepted for + compatibility with NumPy. Returns ------- @@ -1311,6 +1332,9 @@ def add_categories(self, new_categories) -> Self: ---------- new_categories : category or list-like of category The new categories to be included. + *args, **kwargs : optional + Additional keywords have no effect but might be accepted for + compatibility with NumPy. Returns ------- @@ -1380,6 +1404,9 @@ def remove_categories(self, removals) -> Self: ---------- removals : category or list of categories The categories which should be removed. + *args, **kwargs : optional + Additional keywords have no effect but might be accepted for + compatibility with NumPy. Returns ------- @@ -1433,6 +1460,12 @@ def remove_unused_categories(self) -> Self: """ Remove categories which are not used. + Parameters + ---------- + *args, **kwargs : optional + Additional keywords have no effect but might be accepted for + compatibility with NumPy. + Returns ------- Categorical