Skip to content
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

Doc: fix PR01 docstring errors for pandas.CategoricalIndex.equals and pandas.CategoricalIndex.map #57611

Merged
merged 2 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 0 additions & 4 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
pandas.CategoricalDtype.ordered\
pandas.CategoricalIndex.as_ordered\
pandas.CategoricalIndex.as_unordered\
pandas.CategoricalIndex.equals\
pandas.CategoricalIndex.ordered\
pandas.CategoricalIndex.remove_unused_categories\
pandas.CategoricalIndex.rename_categories\
Expand Down Expand Up @@ -1458,8 +1457,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then

MSG='Partially validate docstrings (PR01)' ; echo $MSG
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=PR01 --ignore_functions \
pandas.CategoricalIndex.equals\
pandas.CategoricalIndex.map\
pandas.DataFrame.at_time\
pandas.DataFrame.backfill\
pandas.DataFrame.get\
Expand Down Expand Up @@ -2166,7 +2163,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
pandas.CategoricalIndex.as_ordered\
pandas.CategoricalIndex.as_unordered\
pandas.CategoricalIndex.codes\
pandas.CategoricalIndex.equals\
pandas.CategoricalIndex.ordered\
pandas.DataFrame.__dataframe__\
pandas.DataFrame.__iter__\
Expand Down
15 changes: 15 additions & 0 deletions pandas/core/indexes/category.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,24 @@ def equals(self, other: object) -> bool:
"""
Determine if two CategoricalIndex objects contain the same elements.
The order and orderedness of elements matters. The categories matter,
but the order of the categories matters only when ``ordered=True``.
Parameters
----------
other : object
The CategoricalIndex object to compare with.
Returns
-------
bool
``True`` if two :class:`pandas.CategoricalIndex` objects have equal
elements, ``False`` otherwise.
See Also
--------
Categorical.equals : Returns True if categorical arrays are equal.
Examples
--------
>>> ci = pd.CategoricalIndex(["a", "b", "c", "a", "b", "c"])
Expand Down Expand Up @@ -446,6 +458,9 @@ def map(self, mapper, na_action: Literal["ignore"] | None = None):
----------
mapper : function, dict, or Series
Mapping correspondence.
na_action : {None, 'ignore'}, default 'ignore'
If 'ignore', propagate NaN values, without passing them to
the mapping correspondence.
Returns
-------
Expand Down
Loading