Skip to content

Commit

Permalink
DOC: fix PR07,RT03,SA01 for pandas.MultiIndex.drop (#59264)
Browse files Browse the repository at this point in the history
  • Loading branch information
tuhinsharma121 authored Jul 17, 2024
1 parent a2710a8 commit dec86b3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
1 change: 0 additions & 1 deletion ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.Series.dt PR01" `# Accessors are implemented as classes, but we do not document the Parameters section` \
-i "pandas.MultiIndex.append PR07,SA01" \
-i "pandas.MultiIndex.copy PR07,RT03,SA01" \
-i "pandas.MultiIndex.drop PR07,RT03,SA01" \
-i "pandas.MultiIndex.get_level_values SA01" \
-i "pandas.MultiIndex.get_loc PR07" \
-i "pandas.MultiIndex.get_loc_level PR07" \
Expand Down
16 changes: 16 additions & 0 deletions pandas/core/indexes/multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -2316,16 +2316,32 @@ def drop( # type: ignore[override]
"""
Make a new :class:`pandas.MultiIndex` with the passed list of codes deleted.
This method allows for the removal of specified labels from a MultiIndex.
The labels to be removed can be provided as a list of tuples if no level
is specified, or as a list of labels from a specific level if the level
parameter is provided. This can be useful for refining the structure of a
MultiIndex to fit specific requirements.
Parameters
----------
codes : array-like
Must be a list of tuples when ``level`` is not specified.
level : int or level name, default None
Level from which the labels will be dropped.
errors : str, default 'raise'
If 'ignore', suppress error and existing labels are dropped.
Returns
-------
MultiIndex
A new MultiIndex with the specified labels removed.
See Also
--------
MultiIndex.remove_unused_levels : Create new MultiIndex from current that
removes unused levels.
MultiIndex.reorder_levels : Rearrange levels using input order.
MultiIndex.rename : Rename levels in a MultiIndex.
Examples
--------
Expand Down

0 comments on commit dec86b3

Please sign in to comment.