PySpark: How to fillna values in dataframe for specific columns?
df.fillna(0, subset=['a', 'b'])
There is a parameter named subset
to choose the columns unless your spark version is lower than 1.3.1
Use a dictionary to fill values of certain columns:
df.fillna( { 'a':0, 'b':0 } )