Skip to content

BUG: groupby.size and groupby.transform('size') incorrect for axis=1 #45987

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

Merged
merged 3 commits into from
Feb 15, 2022

Conversation

rhshadrach
Copy link
Member

@jreback jreback added this to the 1.5 milestone Feb 15, 2022
@jreback jreback merged commit 15a06d3 into pandas-dev:main Feb 15, 2022
@jreback
Copy link
Contributor

jreback commented Feb 15, 2022

thanks @rhshadrach

[0, 1, 1, 1],
[1, 0, 1, 1],
[0, None, None, None],
pytest.param([None, None, None, None], marks=pytest.mark.xfail),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rhshadrach im trying to chase down xfails and im not even sure what this means. what do you expect df.groupby(by=[None]*4, ...) to do?

Copy link
Member Author

@rhshadrach rhshadrach Jan 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current tlyhe [0, 1, 1, 1] case is returning

0    1
1    3
dtype: int64

When dropna=True, I'd expect 4 * [None] to return Series([], dtype='int64') and when dropna=False, I'd expect

np.nan   4
dtype: int64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: GroupBy.size incorrect for axis=1
3 participants