-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: .groupby on Series' values without reindexing #15340
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
Conversation
see my comments on the issue. |
Codecov Report@@ Coverage Diff @@
## master #15340 +/- ##
=======================================
Coverage 86.32% 86.32%
=======================================
Files 141 141
Lines 51165 51165
=======================================
Hits 44169 44169
Misses 6996 6996
Continue to review full report at Codecov.
|
so this changes the actual behavior. why is this warranted? |
I don't know if it is. The docs say in case of series, the values will be used as grouping keys. I guess in this instance I don't see series as much different from any other series of values, like lists or numpy arrays. I don't know why aligning is necessary, particularly if the series of keys comes from another source (if not, why would it be passed as a series explicitly instead of by a column reference), in which case the index can be arbitrary and the result of alignment just as so. In other words, if the grouping series is from the same source (i.e. the same frame) as the grouped object, then it already shares the same index, hence aligning is not necessary. Ideally, I'd have Of course, Series is not a Sequence?? 😳 |
It's wholly compatible with the docs, and it doesn't break any previous tests. 😆 |
@kernc this certainly changes behavior. The entire point is to align. This is actually very confusing what you changed. Virtually every operation in pandas aligns. Why would this not? |
Thanks for treating me like a pandas expert I'm not. ❤️ In that case, I agree a remark in the docs (docstring) would be welcome. |
@kernc hahh, np. if you'd like to do a PR for the doc-string would be great. |
git diff upstream/master | flake8 --diff