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
MultiIndex names get lost in the returned dataframe after sort_index is used.
Here is an example:
In [1]: import pandas
In [2]: pandas.__version__
Out[2]: '0.4.3'
In [3]: index = pandas.MultiIndex.from_tuples([('x','y','z'), ('a','b','c'), ('p','q','r')], names=['one','two','three'])
In [4]: df = pandas.DataFrame(randn(3, 5), index=index)
In [5]: df
Out[5]:
0 1 2 3 4
x y z -1.098 -0.3314 -0.5526 0.3791 1.12
a b c 1.141 0.3309 -0.6509 -0.561 -1.086
p q r 0.3399 -0.3135 1.677 0.533 0.1158
In [6]: df.index.names
Out[6]: ['one', 'two', 'three']
In [7]: dfs = df.sort_index()
In [8]: dfs
Out[8]:
0 1 2 3 4
a b c 1.141 0.3309 -0.6509 -0.561 -1.086
p q r 0.3399 -0.3135 1.677 0.533 0.1158
x y z -1.098 -0.3314 -0.5526 0.3791 1.12
In [9]: dfs.index.names
Out[9]: [None, None, None]
The text was updated successfully, but these errors were encountered:
Mdp 1293 VersionStore.append safety
A few changes here to ensure that append doesn't corrupt data in cases were find returns an incomplete set of chunks.
This might occur if a concurrent writer is updating / pruning the chunks, or during a failover if we're unlucky enough to query the new primary before all oplog entries have been applied to the indexes.
The text was updated successfully, but these errors were encountered: