Skip to content

DOC: Clarify that methods taking a MultiIndex level index also accept the name #6500

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 3 commits into from
Feb 27, 2014
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -3850,7 +3850,7 @@ def count(self, axis=0, level=None, numeric_only=False):
----------
axis : {0, 1}
0 for row-wise, 1 for column-wise
level : int, default None
level : int or level name, default None
If the axis is a MultiIndex (hierarchical), count along a
particular level, collapsing into a DataFrame
numeric_only : boolean, default False
Expand Down Expand Up @@ -3926,7 +3926,7 @@ def any(self, axis=None, bool_only=None, skipna=True, level=None,
skipna : boolean, default True
Exclude NA/null values. If an entire row/column is NA, the result
will be NA
level : int, default None
level : int or level name, default None
If the axis is a MultiIndex (hierarchical), count along a
particular level, collapsing into a DataFrame
bool_only : boolean, default None
Expand Down Expand Up @@ -3957,7 +3957,7 @@ def all(self, axis=None, bool_only=None, skipna=True, level=None,
skipna : boolean, default True
Exclude NA/null values. If an entire row/column is NA, the result
will be NA
level : int, default None
level : int or level name, default None
If the axis is a MultiIndex (hierarchical), count along a
particular level, collapsing into a DataFrame
bool_only : boolean, default None
Expand Down
6 changes: 3 additions & 3 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1399,7 +1399,7 @@ def drop(self, labels, axis=0, level=None, inplace=False, **kwargs):
----------
labels : single label or list-like
axis : int or axis name
level : int or name, default None
level : int or level name, default None
For MultiIndex
inplace : bool, default False
If True, do operation inplace and return None.
Expand Down Expand Up @@ -2869,7 +2869,7 @@ def align(self, other, join='outer', axis=None, level=None, copy=True,
join : {'outer', 'inner', 'left', 'right'}, default 'outer'
axis : allowed axis of the other object, default None
Align on index (0), columns (1), or both (None)
level : int or name
level : int or level name, default None
Broadcast across a level, matching Index values on the
passed MultiIndex level
copy : boolean, default True
Expand Down Expand Up @@ -3454,7 +3454,7 @@ def _add_numeric_operations(cls):
skipna : boolean, default True
Exclude NA/null values. If an entire row/column is NA, the result
will be NA
level : int, default None
level : int or level name, default None
If the axis is a MultiIndex (hierarchical), count along a
particular level, collapsing into a """ + name + """
numeric_only : boolean, default None
Expand Down
7 changes: 4 additions & 3 deletions pandas/core/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -1334,7 +1334,7 @@ def join(self, other, how='left', level=None, return_indexers=False):
----------
other : Index
how : {'left', 'right', 'inner', 'outer'}
level :
level : int or level name, default None
return_indexers : boolean, default False

Returns
Expand Down Expand Up @@ -2463,7 +2463,7 @@ def get_level_values(self, level):

Parameters
----------
level : int
level : int or level name

Returns
-------
Expand Down Expand Up @@ -2846,7 +2846,7 @@ def drop(self, labels, level=None):
----------
labels : array-like
Must be a list of tuples
level : int or name, default None
level : int or level name, default None

Returns
-------
Expand Down Expand Up @@ -3242,6 +3242,7 @@ def get_loc_level(self, key, level=0, drop_level=True):
Parameters
----------
key : label or tuple
level : int/level name or list thereof

Returns
-------
Expand Down
6 changes: 3 additions & 3 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,7 @@ def count(self, level=None):

Parameters
----------
level : int, default None
level : int or level name, default None
If the axis is a MultiIndex (hierarchical), count along a
particular level, collapsing into a smaller Series

Expand Down Expand Up @@ -1512,7 +1512,7 @@ def _binop(self, other, func, level=None, fill_value=None):
fill_value : float or object
Value to substitute for NA/null values. If both Series are NA in a
location, the result will be NA regardless of the passed fill value
level : int or name
level : int or level name, default None
Broadcast across a level, matching Index values on the
passed MultiIndex level

Expand Down Expand Up @@ -1802,7 +1802,7 @@ def sortlevel(self, level=0, ascending=True):

Parameters
----------
level : int
level : int or level name, default None
ascending : bool, default True

Returns
Expand Down