Skip to content

Strange results when slicing objects using ix #3836

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
hayd opened this issue Jun 10, 2013 · 2 comments
Closed

Strange results when slicing objects using ix #3836

hayd opened this issue Jun 10, 2013 · 2 comments
Labels

Comments

@hayd
Copy link
Contributor

hayd commented Jun 10, 2013

Here's a weird one from SO. Bug in 0.11.0 (fixed in dev).

accurate_ICB = ['SA EQUITY CFD', 'SA EQUITY', 'SA SSF']
data = {'Classification': ['SA EQUITY CFD', 'bbb', 'SA EQUITY', 'SA SSF', 'aaa'],
    'Random': [1,2,3,4,5],
    'X': ['correct', 'wrong','correct', 'correct','wrong']}
df =pd.DataFrame(data)
x = df[~df.Classification.isin(accurate_ICB)]
df.ix[x.index,'X'] = df['Classification']
print df

In pandas 0.11.0 it produces:

  Classification  Random        X
0  SA EQUITY CFD       1  correct
1            bbb       2      bbb
2      SA EQUITY       3  correct
3         SA SSF       4  correct
4            aaa       5      bbb

In pandas 0.11.1dev it produces:

  Classification  Random        X
0  SA EQUITY CFD       1  correct
1            bbb       2      bbb
2      SA EQUITY       3  correct
3         SA SSF       4  correct
4            aaa       5      aaa
@hayd
Copy link
Contributor Author

hayd commented Jun 10, 2013

Will add test case for it.

@jreback
Copy link
Contributor

jreback commented Jun 10, 2013

We had a couple of bug fixes related to this #3670,
so was a bug (but pls add this case in any event)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants