Skip to content
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

DataFrame.set_value() issue #911

Closed
lodagro opened this issue Mar 14, 2012 · 2 comments
Closed

DataFrame.set_value() issue #911

lodagro opened this issue Mar 14, 2012 · 2 comments
Labels
Milestone

Comments

@lodagro
Copy link
Contributor

lodagro commented Mar 14, 2012

Accedentically swapping the index and column label in using DataFrame.set_value() gave an unexpected result.
All values, except the one to be set, in the DataFrame became NaN.

In [4]: df
Out[4]:
          A         B         C
0  0.463981  0.163885  0.644793
1  0.979047  0.347373  0.736267
2  0.103155  0.304439  0.911314

In [5]: df.set_value('C', 2, 1.0)
Out[5]:
    A   B   C   2
0 NaN NaN NaN NaN
1 NaN NaN NaN NaN
2 NaN NaN NaN NaN
C NaN NaN NaN   1

In [6]: pandas.__version__
Out[6]: '0.7.2.dev-79decd7'
@adamklein
Copy link
Contributor

Thx for fixing!

@AhmedGS
Copy link

AhmedGS commented Dec 14, 2017

I got once the same output but this was due to index out of bound, the set_value() doesn't raise an issue but you will get one values and the remaining ones NaNs.

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

3 participants