-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: DataFrame.shift(axis=1) with multiple blocks of same type #10539
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
Comments
just needs to have a call to consolidate before it goes to the block manager |
@jreback sorry, i somehow pasted the same example twice, original comment updated. Consolidate would solve the two integer block case, but not the different data dtype case, unless I'm fundamentally misunderstanding what consolidate does? |
yes could be 2 different bugs |
The problem is that if you have multiple blocks, then you can't compute shift with axis=1 by shifting each block separately and then putting them together, which is what the current implementation tries to do. |
This is still a remaining issue. It was only solved for data frame made of blocks of the same type. For mixed types shift on columns does not work properly. See in the example by changing to |
closed by #35578 |
Shows up whenver you have multiple blocks of the same type in a dataframe.
Int example:
Or with different data types:
I expect a similar issue pops up with panels and ndframes when shifting across the axis where dtypes can change.
Perhaps this can be fixed by having shift move the column labels rather than the data here?
The text was updated successfully, but these errors were encountered: