-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
BUG/TST: verify that groupby apply with a column aggregation does not return the column #7002
Comments
Extending the example to Should that behavior be preserved? |
Why not? |
If nobody is currently working on this, I'd like to look more into it. |
I guess this could be closed. df = pd.DataFrame({'foo1': ['one', 'two', 'two', 'three', 'one', 'two'],
...: 'foo2': np.random.randn(6)})
df
Out[4]:
foo1 foo2
0 one 0.404196
1 two -0.484634
2 two 1.033869
3 three -0.368001
4 one -2.506380
5 two 0.807768
df.groupby('foo1',as_index=False).apply(lambda x: x.mean())
Out[5]:
foo1 foo2
0 one -1.051092
1 three -0.368001
2 two 0.452334
df.groupby('foo1',as_index=False).mean()
Out[6]:
foo1 foo2
0 one -1.051092
1 three -0.368001
2 two 0.452334 |
this was recently patched and we should have a test for it if you like to check (otherwise a PR with this test case would be ok) |
Sorry for this many commits... It was my first PR. |
…ns the column (pandas-dev#7002)" This reverts commit 2e77cef.
related #7000
This should return the foo1 column as well
The text was updated successfully, but these errors were encountered: