Skip to content

DOC: Fixed PR01 for pandas.Series.cat #58750

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand Down
33 changes: 33 additions & 0 deletions pandas/core/arrays/categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
-------
Expand Down Expand Up @@ -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
-------
Expand Down Expand Up @@ -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
-------
Expand Down Expand Up @@ -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
-------
Expand Down Expand Up @@ -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
-------
Expand Down Expand Up @@ -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
Expand Down
Loading