Skip to content

Commit 31dc138

Browse files
Doc: fix PR01 docstring errors for pandas.CategoricalIndex.equals and pandas.CategoricalIndex.map (#57611)
fix docstring errors for pandas.CategoricalIndex.equals and pandas.CategoricalIndex.map
1 parent b6230f3 commit 31dc138

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

ci/code_checks.sh

-3
Original file line numberDiff line numberDiff line change
@@ -414,8 +414,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
414414

415415
MSG='Partially validate docstrings (PR01)' ; echo $MSG
416416
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=PR01 --ignore_functions \
417-
pandas.CategoricalIndex.equals\
418-
pandas.CategoricalIndex.map\
419417
pandas.DataFrame.at_time\
420418
pandas.DataFrame.backfill\
421419
pandas.DataFrame.get\
@@ -1117,7 +1115,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
11171115
pandas.CategoricalIndex.as_ordered\
11181116
pandas.CategoricalIndex.as_unordered\
11191117
pandas.CategoricalIndex.codes\
1120-
pandas.CategoricalIndex.equals\
11211118
pandas.CategoricalIndex.ordered\
11221119
pandas.DataFrame.__dataframe__\
11231120
pandas.DataFrame.__iter__\

pandas/core/indexes/category.py

+15
Original file line numberDiff line numberDiff line change
@@ -276,12 +276,24 @@ def equals(self, other: object) -> bool:
276276
"""
277277
Determine if two CategoricalIndex objects contain the same elements.
278278
279+
The order and orderedness of elements matters. The categories matter,
280+
but the order of the categories matters only when ``ordered=True``.
281+
282+
Parameters
283+
----------
284+
other : object
285+
The CategoricalIndex object to compare with.
286+
279287
Returns
280288
-------
281289
bool
282290
``True`` if two :class:`pandas.CategoricalIndex` objects have equal
283291
elements, ``False`` otherwise.
284292
293+
See Also
294+
--------
295+
Categorical.equals : Returns True if categorical arrays are equal.
296+
285297
Examples
286298
--------
287299
>>> ci = pd.CategoricalIndex(["a", "b", "c", "a", "b", "c"])
@@ -446,6 +458,9 @@ def map(self, mapper, na_action: Literal["ignore"] | None = None):
446458
----------
447459
mapper : function, dict, or Series
448460
Mapping correspondence.
461+
na_action : {None, 'ignore'}, default 'ignore'
462+
If 'ignore', propagate NaN values, without passing them to
463+
the mapping correspondence.
449464
450465
Returns
451466
-------

0 commit comments

Comments
 (0)