-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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: groupby sum, mean, var should always be floats #41139
Conversation
…an_median_float � Conflicts: � pandas/core/dtypes/cast.py
8c16be3
to
eb57258
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good. +1 generally on this behavior.
…an_median_float � Conflicts: � doc/source/whatsnew/v1.3.0.rst � pandas/core/groupby/generic.py � pandas/core/groupby/groupby.py � pandas/tests/groupby/test_groupby.py
looks good. can you add a whatsnew note. might consider a sub-section as this is a 'bigger' bug fix but either way. |
@jreback Thanks - whatsnew section added. |
…an_median_float
thanks @rhshadrach |
@@ -1687,7 +1687,7 @@ def f(data, add_arg): | |||
|
|||
# Testing dataframe | |||
df = DataFrame({"A": 1, "B": 2}, index=date_range("2017", periods=10)) | |||
result = df.groupby("A").resample("D").agg(f, multiplier) | |||
result = df.groupby("A").resample("D").agg(f, multiplier).astype(float) | |||
expected = df.groupby("A").resample("D").mean().multiply(multiplier) | |||
# TODO: GH 41137 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rhshadrach does this PR take care of the TODO comment here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes - thanks, I've opened #44374
Built on top of #40790