Skip to content

DOC: updated multi.py docstring for SS06 errors #34775

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

Merged
merged 1 commit into from
Jun 14, 2020
Merged
Changes from all commits
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
33 changes: 18 additions & 15 deletions pandas/core/indexes/multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -903,8 +903,7 @@ def _set_codes(

def set_codes(self, codes, level=None, inplace=False, verify_integrity=True):
"""
Set new codes on MultiIndex. Defaults to returning
new index.
Set new codes on MultiIndex. Defaults to returning new index.

.. versionadded:: 0.24.0

Expand Down Expand Up @@ -1541,8 +1540,9 @@ def _get_level_values(self, level, unique=False):

def get_level_values(self, level):
"""
Return vector of label values for requested level,
equal to the length of the index.
Return vector of label values for requested level.

Length of returned vector is equal to the length of the index.

Parameters
----------
Expand Down Expand Up @@ -1797,12 +1797,12 @@ def _sort_levels_monotonic(self):

def remove_unused_levels(self):
"""
Create a new MultiIndex from the current that removes
unused levels, meaning that they are not expressed in the labels.
Create new MultiIndex from current that removes unused levels.

The resulting MultiIndex will have the same outward
appearance, meaning the same .values and ordering. It will also
be .equals() to the original.
Unused level(s) means levels that are not expressed in the
labels. The resulting MultiIndex will have the same outward
appearance, meaning the same .values and ordering. It will
also be .equals() to the original.

Returns
-------
Expand Down Expand Up @@ -2195,8 +2195,10 @@ def cats(level_codes):

def sortlevel(self, level=0, ascending=True, sort_remaining=True):
"""
Sort MultiIndex at the requested level. The result will respect the
original ordering of the associated factor at that level.
Sort MultiIndex at the requested level.

The result will respect the original ordering of the associated
factor at that level.

Parameters
----------
Expand Down Expand Up @@ -2634,8 +2636,10 @@ def _get_loc_single_level_index(self, level_index: Index, key: Hashable) -> int:

def get_loc(self, key, method=None):
"""
Get location for a label or a tuple of labels as an integer, slice or
boolean mask.
Get location for a label or a tuple of labels.

The location is returned as an integer/slice or boolean
mask.

Parameters
----------
Expand Down Expand Up @@ -2743,8 +2747,7 @@ def _maybe_to_slice(loc):

def get_loc_level(self, key, level=0, drop_level: bool = True):
"""
Get both the location for the requested label(s) and the
resulting sliced index.
Get location and sliced index for requested label(s)/level(s).

Parameters
----------
Expand Down