Skip to content
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

Merged
merged 13 commits into from
May 21, 2021

Conversation

rhshadrach
Copy link
Member

Built on top of #40790

@rhshadrach rhshadrach added Bug Dtype Conversions Unexpected or buggy dtype conversions Groupby labels Apr 24, 2021
 into mean_median_float

� Conflicts:
�	pandas/core/groupby/ops.py
�	pandas/tests/groupby/test_categorical.py
�	pandas/tests/groupby/test_function.py
�	pandas/tests/reshape/test_pivot.py
Copy link
Contributor

@jreback jreback left a 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.

pandas/core/groupby/ops.py Show resolved Hide resolved
pandas/tests/groupby/aggregate/test_aggregate.py Outdated Show resolved Hide resolved
…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
@rhshadrach rhshadrach marked this pull request as ready for review May 6, 2021 03:54
@jreback jreback added this to the 1.3 milestone May 6, 2021
@jreback
Copy link
Contributor

jreback commented May 6, 2021

looks good. can you add a whatsnew note. might consider a sub-section as this is a 'bigger' bug fix but either way.

@rhshadrach
Copy link
Member Author

@jreback Thanks - whatsnew section added.

@jreback jreback merged commit 16b626a into pandas-dev:master May 21, 2021
@jreback
Copy link
Contributor

jreback commented May 21, 2021

thanks @rhshadrach

@rhshadrach rhshadrach deleted the mean_median_float branch May 21, 2021 14:13
TLouf pushed a commit to TLouf/pandas that referenced this pull request Jun 1, 2021
JulianWgs pushed a commit to JulianWgs/pandas that referenced this pull request Jul 3, 2021
@@ -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
Copy link
Member

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?

Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Dtype Conversions Unexpected or buggy dtype conversions Groupby
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: groupby mean/median/var should always be float values
3 participants