Skip to content

Conversation

jreback
Copy link
Contributor

@jreback jreback commented Feb 16, 2014

closes #5567

In [1]: mi = MultiIndex.from_tuples([(x,y) for x in range(1000) for y in range(1000)])

In [2]: s =  Series(np.random.randn(1000000), index=mi)

In [5]: %time x=s.ix[999]
CPU times: user 4 ms, sys: 0 ns, total: 4 ms
Wall time: 3.74 ms

In [6]: mi = MultiIndex.from_tuples([(x,y) for x in range(1000) for y in range(1000)])

In [7]: s =  Series(np.random.randn(1000000), index=mi)

In [8]: df = DataFrame(s)

In [9]: %time x=df.ix[999]
CPU times: user 4 ms, sys: 0 ns, total: 4 ms
Wall time: 4.7 ms

@jreback jreback added this to the 0.14.0 milestone Feb 16, 2014
jreback added a commit that referenced this pull request Feb 16, 2014
PERF: change Series indexing on multi-indexes to use a fast path (GH5567)
@jreback jreback merged commit 3a78f7f into pandas-dev:master Feb 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Indexing Related to indexing on series/frames, not to indexes themselves MultiIndex Performance Memory or execution speed performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PERF: .ix performance on series
1 participant