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

Pandas ignores index when assigning different dtypes. #8387

Closed
smatting opened this issue Sep 25, 2014 · 1 comment
Closed

Pandas ignores index when assigning different dtypes. #8387

smatting opened this issue Sep 25, 2014 · 1 comment
Labels
Bug Indexing Related to indexing on series/frames, not to indexes themselves
Milestone

Comments

@smatting
Copy link

Consider the following example:

import pandas

foo = pandas.Series( [ 0, 1, 2, 0 ] )

w   = foo > 0
bar = foo[ w ].map( str )
print bar

foo[w] = bar
print foo

foo[w] = bar
print foo

gives the following output

1    1
2    2
dtype: object

0      0
1    NaN
2      1
3      0
dtype: object

0    0
1    1
2    2
3    0
dtype: object

It looks as if in the first assignemend foo[w] = bar the matching index of both sides is ignored.

Is this a bug or documented behavior?

@jreback jreback added Bug Indexing Related to indexing on series/frames, not to indexes themselves labels Sep 26, 2014
@jreback jreback modified the milestones: 0.15.1, 0.15.0 Sep 26, 2014
@jreback
Copy link
Contributor

jreback commented Sep 29, 2014

closed by #8394

@jreback jreback closed this as completed Sep 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Indexing Related to indexing on series/frames, not to indexes themselves
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants