Python Pandas replace NaN in one column with value from corresponding row of second column

后端 未结 3 2195
遥遥无期
遥遥无期 2020-12-04 08:17

I am working with this Pandas DataFrame in Python.

File    heat    Farheit Temp_Rating
   1    YesQ         75         N/A
   1    NoR         115         N/         


        
3条回答
  •  情歌与酒
    2020-12-04 09:08

    The above mentioned solutions did not work for me. The method I used was:

    df.loc[df['foo'].isnull(),'foo'] = df['bar']
    

提交回复
热议问题