-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
REGR: 1.3 behavior change with groupby and asindex=False #41998
Comments
Thanks @aberres for the report
first bad commit: [48a5853] REF: preserve Index dtype in BlockManager._combine (#41354) before this commit the result was
which is consistent with the result from a non-empty DataFrame, unlike the result on 1.2.4 which was an empty DataFrame with no columns |
Yep my ci picked that up as well. Should we label this as a regression @simonjayhawkins ? |
sure. I left it in the needs triage state for another set of eyes as I only bisected the change of behavior. If we use a populated DataFrame in the code sample instead of an empty one. the result does not make much sense to me. |
This one fails too:
The initial code snippet seems a bit artificial to me, mostly because I don't know what to actually expect. But this one returned
on 1.2.4 which looks sensible to me. |
ive got it on my todo list (i.e. an open browser tab) to look at this, but nothing obvious off the top of my head |
The method
This fixes the issue in the OP and gives the output
which seems to me in-line with the result of
which gives
However, for the issue in #41998 (comment), it gives
which to me looks wrong - as @phofl said we should also be getting the column 'b'. I don't this the column information in the |
Ah - this path is dropping column 'b' because it is object dtype. Doing
gives
which is better. Running tests now, PR to follow. |
Code Sample, a copy-pastable example
Problem description
With 1.3rc1 this fails with
ValueError: Length of values (0) does not match length of index (1)
while 1.2 returns and empty frame.Expected Output
If this is the expected behavior fine. Just wanted to ensure that it is not an accidental regression.
The text was updated successfully, but these errors were encountered: