A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/13354 below:

margins_name is ignored when there aggfunc is list · Issue #13354 · pandas-dev/pandas · GitHub

Code Sample, a copy-pastable example if possible
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])

Will ignore the margins_name

Expected Output
      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
output of pd.show_versions()
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

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4