pydata/pandas — pull request #4018 by jreback (2013-06-25 00:14:19+00:00)
Title: BUG: GH4017, efficiently support non-unique indicies with iloc

closes #4017

This was a bug because the iloc was dealing with a non-unique index (and was
reindexing which is not correct in this situation, instead can effectively
take)

```
In [1]: df= DataFrame({'A' : [0.1] * 300000, 'B' : [1] * 300000})

In [2]: idx = np.array(range(3000)) * 99

In [3]: expected = df.iloc[idx]

In [4]: df2 = DataFrame({'A' : [0.1] * 100000, 'B' : [1] * 100000})

In [5]: df2 = pd.concat([df, 2*df, 3*df])

In [6]: result = df2.iloc[idx]

In [7]: %timeit df.iloc[idx]
1000 loops, best of 3: 267 us per loop

In [8]: %timeit df2.iloc[idx]
1000 loops, best of 3: 199 us per loop

In [9]: (expected==result).all()
Out[9]:
A True
B True
dtype: bool

```