when using df.astype(str), the null value change to 'nan'?
RainFung opened this issue · comments
rain commented
when using df.astype(str), the null value change to 'nan'?
rain commented
Is there a way to keep null value ?
Haejoon Lee commented
Could you give some more detail about the issue??
For me, the null values are changed to None
, not nan
as below?
>>> ks.DataFrame({"A": [1, 2, None], "B": ["a", "b", None], "C": [False, True, None]}).astype(str)
A B C
0 1.0 a false
1 2.0 b true
2 None None None
rain commented
When I write the dataframe to database table, it raise nan
.