Replace None with NaN in pandas dataframe

后端 未结 5 1256
抹茶落季
抹茶落季 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:12

    Here's another option:

    df.replace(to_replace=[None], value=np.nan, inplace=True)
    

提交回复
热议问题