Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
diff(axis=1) after insert results in unexpected NaN column #10907
Comments
|
This needs a
|
jreback
added Bug Prio-medium Reshaping Difficulty Novice Internals Effort Low
labels
Aug 26, 2015
jreback
added this to the
Next Major Release
milestone
Aug 26, 2015
|
pull-requests welcome! |
dadkins
commented
Aug 26, 2015
|
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) |
terrytangyuan
referenced
this issue
Aug 29, 2015
Closed
fixed bug in DataFrame.diff - issue #10907 #10930
jreback
modified the milestone: 0.17.0, Next Major Release
Aug 30, 2015
jreback
added a commit
that referenced
this issue
Sep 1, 2015
|
|
terrytangyuan + jreback |
219ad75
|
|
closed by #10930 |
jreback
closed this
Sep 1, 2015
hhuuggoo
referenced
this issue
Sep 11, 2015
Closed
shifting across blocks results in NaNs if dataframe has multiple blocks (mixed types) #11061
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
dadkins commentedAug 26, 2015
The following code in pandas 0.16.2 demonstrates the problem:
The following workaround produces the expected result:
Versions: