You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dataframe.sum returns an error with MultiIndex columns, several levels and skipna=False. However it appears to work fine with the transposed version of the dataframe (and axis=0), or with a single level, or with skipna=True.
I would expect a Dataframe with the sum of the columns. Please note that it works fine with MultiIndex index (i.e with the transposed Dataframe and axis=0)
Code Sample, a copy-pastable example
Problem description
Dataframe.sum returns an error with MultiIndex columns, several levels and skipna=False. However it appears to work fine with the transposed version of the dataframe (and axis=0), or with a single level, or with skipna=True.
Expected Output
I would expect a Dataframe with the sum of the columns. Please note that it works fine with MultiIndex index (i.e with the transposed Dataframe and axis=0)
Output of
pd.show_versions()
INSTALLED VERSIONS
commit : db08276
python : 3.8.6.final.0
python-bits : 64
OS : Linux
OS-release : 5.9.0-1-amd64
Version : #1 SMP Debian 5.9.1-1 (2020-10-17)
machine : x86_64
processor :
byteorder : little
LC_ALL : None
LANG : fr_FR.UTF-8
LOCALE : fr_FR.UTF-8
pandas : 1.1.3
numpy : 1.19.3
pytz : 2020.1
dateutil : 2.8.1
pip : 20.1.1
setuptools : 50.3.0
Cython : None
pytest : 4.6.11
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 4.6.1
html5lib : 1.0.1
pymysql : None
psycopg2 : None
jinja2 : 2.11.2
IPython : None
pandas_datareader: None
bs4 : 4.9.3
bottleneck : 1.2.1
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : 3.3.2
numexpr : 2.7.1
odfpy : None
openpyxl : 3.0.3
pandas_gbq : None
pyarrow : None
pytables : None
pyxlsb : None
s3fs : None
scipy : 1.5.2
sqlalchemy : None
tables : 3.6.1
tabulate : None
xarray : None
xlrd : 1.1.0
xlwt : 1.3.0
numba : 0.51.2
The text was updated successfully, but these errors were encountered: