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

REGR: change in Series.astype(str) behavior for None #36904

Closed
itholic opened this issue Oct 6, 2020 · 2 comments · Fixed by #37034
Closed

REGR: change in Series.astype(str) behavior for None #36904

itholic opened this issue Oct 6, 2020 · 2 comments · Fixed by #37034

Comments

@itholic
Copy link

@itholic itholic commented Oct 6, 2020

Question about pandas

Let's say we have a Series with None like the below.

pser = pd.Series(["hi", "hi ", " ", " \t", "", None], name="x")

print(pser)
0      hi
1     hi
2
3      \t
4
5    None
Name: x, dtype: object

the last value is None, but it is casted to nan after using astype with str parameter.

print(pser.astype(str))
0     hi
1    hi
2
3     \t
4
5    nan
Name: x, dtype: object

Is it intended behavior in pandas 1.1.1. ??

Thanks :)

@dsaxton dsaxton changed the title QST: is the new behavior of Series.asof for None after v1.1.1 intended? QST: is the new behavior of Series.astype for None after v1.1.1 intended? Oct 7, 2020
@dsaxton
Copy link
Member

@dsaxton dsaxton commented Oct 7, 2020

Thanks @itholic, this seems like a regression and is due to #35519

cc @topper-123

@dsaxton dsaxton changed the title QST: is the new behavior of Series.astype for None after v1.1.1 intended? REGR: change in Series.astype(str) behavior for None Oct 7, 2020
@dsaxton dsaxton added this to the 1.1.4 milestone Oct 7, 2020
@itholic
Copy link
Author

@itholic itholic commented Oct 7, 2020

Thanks, @dsaxton :)

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

Successfully merging a pull request may close this issue.

2 participants