Skip to content

BUG: Fix selection with ix/loc and non_unique selectors (GH4619) #4622

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

Merged
merged 1 commit into from
Aug 21, 2013

Conversation

jreback
Copy link
Contributor

@jreback jreback commented Aug 21, 2013

closes #4619

In [7]: df = DataFrame({"A": [0, 1, 2]})

In [8]: df
Out[8]: 
   A
0  0
1  1
2  2

In [9]: df.ix[[0,8,0]]
Out[9]: 
    A
0   0
8 NaN
0   0

In [10]: df = DataFrame({"A": list('abc')})

In [12]: df
Out[12]: 
   A
0  a
1  b
2  c

In [11]: df.ix[[0,8,0]]
Out[11]: 
     A
0    a
8  NaN
0    a

and this beauty here!

In [13]: df = DataFrame({'test': [5,7,9,11]}, index=['A','A','B','C'])

In [14]: df
Out[14]: 
   test
A     5
A     7
B     9
C    11

In [15]: df.ix[['A','A','E']]
Out[15]: 
   test
A     5
A     7
A     5
A     7
E   NaN

jreback added a commit that referenced this pull request Aug 21, 2013
BUG: Fix selection with ``ix/loc`` and non_unique selectors (GH4619)
@jreback jreback merged commit 9ea0d44 into pandas-dev:master Aug 21, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unexpected result/segmentation fault with .ix/.loc (0.12.0)
1 participant