Skip to content

Commit a82e2f6

Browse files
committed
DOC: Explain pivot vs. pivot_table (#6950)
1 parent 06b35db commit a82e2f6

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

doc/source/reshaping.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ You of course can then select subsets from the pivoted DataFrame:
9090
Note that this returns a view on the underlying data in the case where the data
9191
are homogeneously-typed.
9292

93+
While ``pivot`` provides general purpose pivoting of DataFrames with various
94+
data types (strings, numerics, etc.), Pandas also provides the ``pivot_table``
95+
function for pivoting with aggregation of numeric data (see the
96+
section on :ref:`pivot tables<reshaping.pivot>`).
97+
9398
.. _reshaping.stacking:
9499

95100
Reshaping by stacking and unstacking

pandas/tools/pivot.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ def pivot_table(data, values=None, index=None, columns=None, aggfunc='mean',
7575
Returns
7676
-------
7777
table : DataFrame
78+
79+
See also
80+
--------
81+
DataFrame.pivot : pivot without aggregation that can handle
82+
non-numeric data
7883
"""
7984
index = _convert_by(index)
8085
columns = _convert_by(columns)

0 commit comments

Comments
 (0)