-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DataFrameGroupBy.cumsum(axis=0) fails when grouped on axis=1 #21127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Just to confirm what is your expected output here? |
I would expect this not to error and to have similar behavior to that when grouping by rows. It should just compute the cumulative sum across columns for each group, or if this does not make sense, at least throw a more descriptive exception specifying that this operation is not supported on It looks like all the cumulative functions fail when grouping by When grouping on |
@kunalgosar : Indeed, this does look weird. Patch is more than welcome! |
All the referred functions have as default
but
gives
My understanding here is that For instance, using
gives
and this results works as expected. But
gives
It returns the |
axis=1 is now deprecated; closing. |
Code Sample, a copy-pastable example if possible
Output of
pd.show_versions()
INSTALLED VERSIONS
commit: d7c6e01
python: 3.6.5.final.0
python-bits: 64
OS: Darwin
OS-release: 17.5.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8
pandas: 0.23.0rc2+30.gd7c6e0130
pytest: 3.5.1
pip: 10.0.1
setuptools: 39.1.0
Cython: 0.28.2
numpy: 1.14.2
scipy: 1.0.1
pyarrow: 0.9.0
xarray: 0.10.3
IPython: 6.3.1
sphinx: 1.7.4
patsy: 0.5.0
dateutil: 2.7.2
pytz: 2018.4
blosc: None
bottleneck: 1.2.1
tables: 3.4.3
numexpr: 2.6.5
feather: 0.4.0
matplotlib: 2.2.2
openpyxl: 2.5.3
xlrd: 1.1.0
xlwt: 1.2.0
xlsxwriter: 1.0.4
lxml: 4.2.1
bs4: 4.6.0
html5lib: 1.0.1
sqlalchemy: 1.2.7
pymysql: 0.8.0
psycopg2: None
jinja2: 2.10
s3fs: 0.1.4
fastparquet: 0.1.5
pandas_gbq: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: