diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 6158e19737185..4770184a7de03 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -9177,11 +9177,11 @@ def groupby( Parameters ----------%s - columns : str or object or a list of str + columns : Hashable or a sequence of the previous Column to use to make new frame's columns. - index : str or object or a list of str, optional + index : Hashable or a sequence of the previous, optional Column to use to make new frame's index. If not given, uses existing index. - values : str, object or a list of the previous, optional + values : Hashable or a sequence of the previous, optional Column(s) to use for populating new frame's values. If not specified, all remaining columns will be used and the result will have hierarchically indexed columns. @@ -9320,12 +9320,12 @@ def pivot( ----------%s values : list-like or scalar, optional Column or columns to aggregate. - index : column, Grouper, array, or list of the previous + index : column, Grouper, array, or sequence of the previous Keys to group by on the pivot table index. If a list is passed, it can contain any of the other types (except list). If an array is passed, it must be the same length as the data and will be used in the same manner as column values. - columns : column, Grouper, array, or list of the previous + columns : column, Grouper, array, or sequence of the previous Keys to group by on the pivot table column. If a list is passed, it can contain any of the other types (except list). If an array is passed, it must be the same length as the data and will be used in diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index ff3879018674e..9df0787a4560d 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -1731,10 +1731,16 @@ def name(self) -> Hashable: """ Return Index or MultiIndex name. + Returns + ------- + label (hashable object) + The name of the Index. + See Also -------- Index.set_names: Able to set new names partially and by level. Index.rename: Able to set new names partially and by level. + Series.name: Corresponding Series property. Examples -------- diff --git a/pandas/core/reshape/pivot.py b/pandas/core/reshape/pivot.py index 4e77f0a6bf5bf..ac89f19b80a0f 100644 --- a/pandas/core/reshape/pivot.py +++ b/pandas/core/reshape/pivot.py @@ -76,12 +76,12 @@ def pivot_table( Input pandas DataFrame object. values : list-like or scalar, optional Column or columns to aggregate. - index : column, Grouper, array, or list of the previous + index : column, Grouper, array, or sequence of the previous Keys to group by on the pivot table index. If a list is passed, it can contain any of the other types (except list). If an array is passed, it must be the same length as the data and will be used in the same manner as column values. - columns : column, Grouper, array, or list of the previous + columns : column, Grouper, array, or sequence of the previous Keys to group by on the pivot table column. If a list is passed, it can contain any of the other types (except list). If an array is passed, it must be the same length as the data and will be used in @@ -708,11 +708,11 @@ def pivot( ---------- data : DataFrame Input pandas DataFrame object. - columns : str or object or a list of str + columns : Hashable or a sequence of the previous Column to use to make new frame's columns. - index : str or object or a list of str, optional + index : Hashable or a sequence of the previous, optional Column to use to make new frame's index. If not given, uses existing index. - values : str, object or a list of the previous, optional + values : Hashable or a sequence of the previous, optional Column(s) to use for populating new frame's values. If not specified, all remaining columns will be used and the result will have hierarchically indexed columns.