For anyone who is still interested in the difference between pivot
and pivot_table
, there are mainly two differences:
pivot_table
is a generalization ofpivot
that can handle duplicate values for one pivoted index/column pair. Specifically, you can givepivot_table
a list of aggregation functions using keyword argumentaggfunc
. The defaultaggfunc
ofpivot_table
isnumpy.mean
.pivot_table
also supports using multiple columns for the index and column of the pivoted table. A hierarchical index will be automatically generated for you.
REF: pivot
and pivot_table