From a7c1990e3802b12829b9888ec4e9a44d51996349 Mon Sep 17 00:00:00 2001 From: Tuhin Sharma Date: Thu, 15 Aug 2024 09:02:25 +0530 Subject: [PATCH] DOC: fix ES01,PR07 for pandas.MultiIndex.names --- ci/code_checks.sh | 1 - pandas/core/indexes/multi.py | 11 +++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 692b86ec731c9..8fa406d672788 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -70,7 +70,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then --format=actions \ -i ES01 `# For now it is ok if docstrings are missing the extended summary` \ -i "pandas.Series.dt PR01" `# Accessors are implemented as classes, but we do not document the Parameters section` \ - -i "pandas.MultiIndex.names SA01" \ -i "pandas.MultiIndex.reorder_levels RT03,SA01" \ -i "pandas.MultiIndex.sortlevel PR07,SA01" \ -i "pandas.MultiIndex.to_frame RT03" \ diff --git a/pandas/core/indexes/multi.py b/pandas/core/indexes/multi.py index 0900121ab717f..d476418aff5fc 100644 --- a/pandas/core/indexes/multi.py +++ b/pandas/core/indexes/multi.py @@ -1636,6 +1636,17 @@ def _set_names(self, names, *, level=None, validate: bool = True) -> None: doc=""" Names of levels in MultiIndex. + This attribute provides access to the names of the levels in a `MultiIndex`. + The names are stored as a `FrozenList`, which is an immutable list-like + container. Each name corresponds to a level in the `MultiIndex`, and can be + used to identify or manipulate the levels individually. + + See Also + -------- + MultiIndex.set_names : Set Index or MultiIndex name. + MultiIndex.rename : Rename specific levels in a MultiIndex. + Index.names : Get names on index. + Examples -------- >>> mi = pd.MultiIndex.from_arrays(