databricks / koalas

Koalas: pandas API on Apache Spark

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

when using df.astype(str), the null value change to 'nan'?

RainFung opened this issue · comments

commented

when using df.astype(str), the null value change to 'nan'?

commented

Is there a way to keep null value ?

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
commented

When I write the dataframe to database table, it raise nan .