Skip to content

BUG: Large MultiIndex-ed series fails on slicing #13113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
max-sixty opened this issue May 8, 2016 · 1 comment
Closed

BUG: Large MultiIndex-ed series fails on slicing #13113

max-sixty opened this issue May 8, 2016 · 1 comment
Labels
Bug Duplicate Report Duplicate issue or pull request Indexing Related to indexing on series/frames, not to indexes themselves MultiIndex

Comments

@max-sixty
Copy link
Contributor

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

@jreback
Copy link
Contributor

jreback commented May 8, 2016

dupe of #12896

there is a bug in ten slicing logic

@jreback jreback closed this as completed May 8, 2016
@jreback jreback added Bug Indexing Related to indexing on series/frames, not to indexes themselves MultiIndex labels May 8, 2016
@jreback jreback added this to the No action milestone May 8, 2016
@jreback jreback added the Duplicate Report Duplicate issue or pull request label May 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Duplicate Report Duplicate issue or pull request Indexing Related to indexing on series/frames, not to indexes themselves MultiIndex
Projects
None yet
Development

No branches or pull requests

2 participants