Skip to content

Commit fe60f43

Browse files
authored
DOC: Fix pivot_table and index.name descriptions (#61455)
1 parent c75171a commit fe60f43

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

pandas/core/frame.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9258,11 +9258,11 @@ def groupby(
92589258
92599259
Parameters
92609260
----------%s
9261-
columns : str or object or a list of str
9261+
columns : Hashable or a sequence of the previous
92629262
Column to use to make new frame's columns.
9263-
index : str or object or a list of str, optional
9263+
index : Hashable or a sequence of the previous, optional
92649264
Column to use to make new frame's index. If not given, uses existing index.
9265-
values : str, object or a list of the previous, optional
9265+
values : Hashable or a sequence of the previous, optional
92669266
Column(s) to use for populating new frame's values. If not
92679267
specified, all remaining columns will be used and the result will
92689268
have hierarchically indexed columns.
@@ -9401,12 +9401,12 @@ def pivot(
94019401
----------%s
94029402
values : list-like or scalar, optional
94039403
Column or columns to aggregate.
9404-
index : column, Grouper, array, or list of the previous
9404+
index : column, Grouper, array, or sequence of the previous
94059405
Keys to group by on the pivot table index. If a list is passed,
94069406
it can contain any of the other types (except list). If an array is
94079407
passed, it must be the same length as the data and will be used in
94089408
the same manner as column values.
9409-
columns : column, Grouper, array, or list of the previous
9409+
columns : column, Grouper, array, or sequence of the previous
94109410
Keys to group by on the pivot table column. If a list is passed,
94119411
it can contain any of the other types (except list). If an array is
94129412
passed, it must be the same length as the data and will be used in

pandas/core/indexes/base.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1731,10 +1731,16 @@ def name(self) -> Hashable:
17311731
"""
17321732
Return Index or MultiIndex name.
17331733
1734+
Returns
1735+
-------
1736+
label (hashable object)
1737+
The name of the Index.
1738+
17341739
See Also
17351740
--------
17361741
Index.set_names: Able to set new names partially and by level.
17371742
Index.rename: Able to set new names partially and by level.
1743+
Series.name: Corresponding Series property.
17381744
17391745
Examples
17401746
--------

pandas/core/reshape/pivot.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,12 @@ def pivot_table(
7676
Input pandas DataFrame object.
7777
values : list-like or scalar, optional
7878
Column or columns to aggregate.
79-
index : column, Grouper, array, or list of the previous
79+
index : column, Grouper, array, or sequence of the previous
8080
Keys to group by on the pivot table index. If a list is passed,
8181
it can contain any of the other types (except list). If an array is
8282
passed, it must be the same length as the data and will be used in
8383
the same manner as column values.
84-
columns : column, Grouper, array, or list of the previous
84+
columns : column, Grouper, array, or sequence of the previous
8585
Keys to group by on the pivot table column. If a list is passed,
8686
it can contain any of the other types (except list). If an array is
8787
passed, it must be the same length as the data and will be used in
@@ -708,11 +708,11 @@ def pivot(
708708
----------
709709
data : DataFrame
710710
Input pandas DataFrame object.
711-
columns : str or object or a list of str
711+
columns : Hashable or a sequence of the previous
712712
Column to use to make new frame's columns.
713-
index : str or object or a list of str, optional
713+
index : Hashable or a sequence of the previous, optional
714714
Column to use to make new frame's index. If not given, uses existing index.
715-
values : str, object or a list of the previous, optional
715+
values : Hashable or a sequence of the previous, optional
716716
Column(s) to use for populating new frame's values. If not
717717
specified, all remaining columns will be used and the result will
718718
have hierarchically indexed columns.

0 commit comments

Comments
 (0)