-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Remove blocks from GroupBy Code #28782
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
Changes from 2 commits
b694b09
ee85e5a
32d1b6b
6115323
2324c0c
5de118f
e6b5fd1
44a0c6a
9efdab6
654ccf2
2d3c5dd
6c521f2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -300,7 +300,7 @@ def test_observed(observed): | |
exp_index = CategoricalIndex( | ||
list("ab"), name="cat", categories=list("abc"), ordered=True | ||
) | ||
expected = DataFrame({"ints": [1.5, 1.5], "val": [20.0, 30]}, index=exp_index) | ||
expected = DataFrame({"ints": [1.5, 1.5], "val": [20, 30]}, index=exp_index) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was coercing to float with the block code but I don't think that was necessarily desired; fits in an int with new impl There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Though we might not want this either. Here is code to reproduce: In [8]: d = {
...: "ints": [1, 1, 2, 2],
...: "val": [10, 20, 30, 40],
...: }
...: df = pd.DataFrame(d)
In [8]: df.groupby(list("abab")).mean()
Out[7]:
ints val
a 1.5 20
b 1.5 30 A typical call to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My intuition is that small changes like this are inevitable when changing from block-wise to column-wise. Definitely happened with arithmetic changeover. |
||
if not observed: | ||
index = CategoricalIndex( | ||
list("abc"), name="cat", categories=list("abc"), ordered=True | ||
|
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.
troubleshooting this chunk of code may be irrelevant if its getting ripped out, but FWIW: there are cases, particularly via L194, where we get here with
result
that is a DataFrame instead of an ndarray/EA. In those cases, the make_block call below raises.