You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When there are NaN values in the index, then reset_index introduces incorrect values. That is the case even if the reset_index operation occurs on a different index than the one containing the NaN values:
This is a dup of #3586, fixed in #3587, currently in master
In [25]: df
Out[25]:
col1 col2
first second
a c 1 8
NaN 2 7
d 3 6
NaN 4 5
b e 5 4
e 6 3
NaN 7 2
f 8 1
In [26]: df.reset_index().set_index('first')
Out[26]:
second col1 col2
first
a c 1 8
a NaN 2 7
a d 3 6
a NaN 4 5
b e 5 4
b e 6 3
b NaN 7 2
b f 8 1
In [27]: df.reset_index().set_index('second')
Out[27]:
first col1 col2
second
c a 1 8
NaN a 2 7
d a 3 6
NaN a 4 5
e b 5 4
e b 6 3
NaN b 7 2
f b 8 1
When there are NaN values in the index, then reset_index introduces incorrect values. That is the case even if the reset_index operation occurs on a different index than the one containing the NaN values:
The text was updated successfully, but these errors were encountered: