With a large MultiIndex-ed series, slicing doesn't fully slice on a 2nd-level.
I've been struggling with this for a while, any ideas greatly appreciated...
In [135]: ints = (pd.np.random.rand(150000)*1e7).round().astype('int')
In [136]: index=pd.MultiIndex.from_arrays([list('a'*50000 + 'b'*50000+'c'*50000), ints])
In [137]: series=pd.Series(np.random.rand(150000), index=index).sort_index()
In [138]: series
Out[138]:
a 66 0.763398
171 0.886328
...
9999825 0.329101
9999933 0.463330
dtype: float64
In [139]: series.loc[(slice(None), slice(5000000))]
Out[139]:
a 66 0.763398
171 0.886328
186 0.315654
...
9720405 0.712525
9925259 0.016771
9978827 0.555781
dtype: float64
... the slice clearly has values both above and below 5,000,000. It does do some slicing though, just not fully.
Or am I making a rookie mistake?
pandas: 0.18.1
Comment From: jreback
dupe of #12896
there is a bug in ten slicing logic