pydata/pandas — pull request #3661 by jreback (2013-05-20 19:44:44+00:00)
Title: BUG: Non-unique indexing via ``loc`` and friends fixed when slicing (GH3659_)

closes #3659

This is if you try a non_monotonic selection on a non_unique index (a mouthful)!
The reason is we cannot determinate a proper start/end point on what to include

```
In [11]: df = DataFrame({'A' : [1,2,3,4,5,6], 'B' : [3,4,5,6,7,8]},
index = [0,1,0,1,2,3])

In [18]: df
Out[18]:
A B
0 1 3
1 2 4
0 3 5
1 4 6
2 5 7
3 6 8

In [12]: df.loc[1:]
KeyError: 'cannot deal with a slice operationon a non_unique non_mononic index'
```
On a non_unique, but monotonic index, however, slicing works normally
(notice, since we are using loc, that both endpoints ARE included)
```
In [13]: df = DataFrame({'A' : [1,2,3,4,5,6], 'B' : [3,4,5,6,7,8]},
index = [0,1,0,1,2,3]).sort(axis=0)

In [14]: df
Out[14]:
A B
0 1 3
0 3 5
1 2 4
1 4 6
2 5 7
3 6 8

In [15]: df.loc[1:]
Out[15]:
A B
1 2 4
1 4 6
2 5 7
3 6 8

In [16]: df.loc[1:2]
Out[16]:
A B
1 2 4
1 4 6
2 5 7
```