BUG: df.pivot_table: margins_name is ignored when there aggfunc is list · Issue #13354 · pandas-dev/pandas (original ) (raw )costs = pd.DataFrame({'item':['bacon','cheese','bacon','cheese'],
'cost':[2.5,4.5,3.2,3.3],
'store':['SuperS','DollarM','SuperS','DollarM'],
'day':['M','M','T','T']})
costs.pivot_table(index="item",columns="day",margins=True, margins_name="Weekly",aggfunc=[np.mean,max])
mean max
cost cost store
M T Weekly M T Weekly M T Weekly
item
bacon 2.5 3.20 2.850 2.5 3.2 3.2 SuperS SuperS SuperS
cheese 4.5 3.30 3.900 4.5 3.3 4.5 DollarM DollarM DollarM
All 3.5 3.25 3.375 4.5 3.3 4.5 SuperS SuperS SuperS
INSTALLED VERSIONS
------------------
commit: None
python: 3.4.3.final.0
python-bits: 64
OS: Linux
OS-release: 3.13.0-43-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
pandas: 0.18.1
nose: None
pip: 1.5.6
setuptools: 20.2.2
Cython: None
numpy: 1.11.0
scipy: 0.17.1
statsmodels: None
xarray: None
IPython: 4.1.2
sphinx: None
patsy: None
dateutil: 2.5.3
pytz: 2016.3
blosc: None
bottleneck: None
tables: None
numexpr: None
matplotlib: 1.5.1
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: 0.9999999
httplib2: 0.9.2
apiclient: 1.5.0
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.8
boto: None
pandas_datareader: None