Replace None with NaN in pandas dataframe

后端 未结 5 1265
抹茶落季
抹茶落季 2021-01-30 00:53

I have table x:

        website
0   http://www.google.com/
1   http://www.yahoo.com
2   None

I want to replace python None with pa

5条回答
  •  庸人自扰
    2021-01-30 01:06

    The following line replaces None with NaN:

    df['column'].replace('None', np.nan, inplace=True)
    

提交回复
热议问题