PySpark: How to fillna values in dataframe for specific columns?

前端 未结 2 1259
北荒
北荒 2020-12-01 09:59

I have the following sample DataFrame:

a    | b    | c   | 

1    | 2    | 4   |
0    | null | null| 
null | 3    | 4   |

And I want to rep

2条回答
  •  执笔经年
    2020-12-01 10:43

    Use a dictionary to fill values of certain columns:

    df.fillna( { 'a':0, 'b':0 } )
    

提交回复
热议问题