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
In [2]: df = pd.DataFrame(0, columns=[], index=pd.MultiIndex.from_product([[], []]))
In [3]: df.loc['b', '2'] = 1
In [4]: df.loc['a', '3'] = 1
In [5]: df.sort_index()
Out[5]:
2 3
b 1.0 NaN
a NaN 1.0
In [6]: df.sort_index().index.is_monotonic
Out[6]: False
Am I missing anything obvious?!
(Notice that this is not related to any of the two axes being initialized as empty)
The text was updated successfully, but these errors were encountered:
toobaz
changed the title
sort_index doesn't sort MultiIndex when .loc[] was referred to non-existent label on other axis
sort_index doesn't sort MultiIndex when .loc[] referred to non-existent label on other axis
Feb 8, 2016
Am I missing anything obvious?!
(Notice that this is not related to any of the two axes being initialized as empty)
The text was updated successfully, but these errors were encountered: