Skip to content

BUG: ser[:] = ["a", 1] casts 1 to "1" #35865

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
jbrockmendel opened this issue Aug 23, 2020 · 2 comments · Fixed by #41077
Closed

BUG: ser[:] = ["a", 1] casts 1 to "1" #35865

jbrockmendel opened this issue Aug 23, 2020 · 2 comments · Fixed by #41077
Assignees
Labels
good first issue Indexing Related to indexing on series/frames, not to indexes themselves Needs Tests Unit test(s) needed to prevent regressions
Milestone

Comments

@jbrockmendel
Copy link
Member

ser = pd.Series(["a", 1])
ser[:] = list(ser.values))

>>> ser[1]
'1'

Looks like we call np.array(ser.values) and the cast happens in there.

@jbrockmendel jbrockmendel added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Aug 23, 2020
@jbrockmendel jbrockmendel added Indexing Related to indexing on series/frames, not to indexes themselves and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Sep 2, 2020
@phofl
Copy link
Member

phofl commented Apr 17, 2021

This works now, may need tests

@phofl phofl added good first issue Needs Tests Unit test(s) needed to prevent regressions and removed Bug labels Apr 17, 2021
@arredond
Copy link
Contributor

take

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Indexing Related to indexing on series/frames, not to indexes themselves Needs Tests Unit test(s) needed to prevent regressions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants