8000 BUG: groupby sum, mean, var should always be floats by rhshadrach · Pull Request #41139 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

BUG: groupby sum, mean, var should always be floats #41139

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 13 commits into from
May 21, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
merge cleanup
  • Loading branch information
rhshadrach committed May 6, 2021
commit bcd369c57a184570a77c9aff48bd4282e1b1ffbc
3 changes: 0 additions & 3 deletions pandas/tests/groupby/aggregate/test_cython.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,6 @@ def test_cython_agg_empty_buckets(op, targop, observed):

g = df.groupby(pd.cut(df[0], grps), observed=observed)
expected = g.agg(lambda x: targop(x))
if observed and op not in ("min", "max"):
# TODO: GH 41137
expected = expected.astype("int64")
tm.assert_frame_equal(result, expected)

< 98A1 br>
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/groupby/test_groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,7 @@ def test_groupby_keys_same_size_as_index():
)
df = DataFrame([["A", 10], ["B", 15]], columns=["metric", "values"], index=index)
result = df.groupby([Grouper(level=0, freq=freq), "metric"]).mean()
expected = df.set_index([df.index, "metric"])
expected = df.set_index([df.index, "metric"]).astype(float)

tm.assert_frame_equal(result, expected)

Expand Down
0