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
diff(axis=1) after insert results in unexpected NaN column #10907
Labels
Milestone
Comments
This needs a
|
jreback
added
Bug
Prio-medium
Reshaping
Concat, Merge/Join, Stack/Unstack, Explode
Internals
Related to non-user accessible pandas implementation
labels
Aug 26, 2015
pull-requests welcome! |
I noticed that shift(axis=1) also has this bug. Are there any others that break across block boundaries? >>> import pandas as pd
>>> df = pd.DataFrame({'y': pd.Series([2]), 'z': pd.Series([3])})
>>> df.insert(0, 'x', 1)
>>> df
x y z
0 1 2 3
>>> df.shift(axis=1)
x y z
0 NaN NaN 2 |
diff is essentially (though not actually implemented) df.sub(df.shift(axis=1),axis=1) |
closed by #10930 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following code in pandas 0.16.2 demonstrates the problem:
The following workaround produces the expected result:
Versions:
The text was updated successfully, but these errors were encountered: