Skip to content

Commit

Permalink
Doc: fix PR01 docstring errors for pandas.CategoricalIndex.equals and…
Browse files Browse the repository at this point in the history
… pandas.CategoricalIndex.map (#57611)

fix docstring errors for pandas.CategoricalIndex.equals and pandas.CategoricalIndex.map
  • Loading branch information
jordan-d-murphy authored Feb 26, 2024
1 parent b6230f3 commit 31dc138
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
3 changes: 0 additions & 3 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,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 @@ -1117,7 +1115,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

0 comments on commit 31dc138

Please sign in to comment.