Skip to content

Commit d6a6036

Browse files
committed
BUG: df.pivot_table: margins_name is ignored when there aggfunc is list #13354
1 parent 62b4327 commit d6a6036

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

doc/source/whatsnew/v0.18.1.txt

+1
Original file line numberDiff line numberDiff line change
@@ -682,3 +682,4 @@ Bug Fixes
682682
- Bug in ``pd.to_numeric()`` with ``Index`` returns ``np.ndarray``, rather than ``Index`` (:issue:`12777`)
683683
- Bug in ``pd.to_numeric()`` with datetime-like may raise ``TypeError`` (:issue:`12777`)
684684
- Bug in ``pd.to_numeric()`` with scalar raises ``ValueError`` (:issue:`12777`)
685+
- Bug in ``pd.pivot_table()`` where margins_name is ignored when aggfunc is a list (:issue:`13354`)

pandas/tools/pivot.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def pivot_table(data, values=None, index=None, columns=None, aggfunc='mean',
8686
table = pivot_table(data, values=values, index=index,
8787
columns=columns,
8888
fill_value=fill_value, aggfunc=func,
89-
margins=margins)
89+
margins=margins, margins_name=margins_name)
9090
pieces.append(table)
9191
keys.append(func.__name__)
9292
return concat(pieces, keys=keys, axis=1)

0 commit comments

Comments
 (0)