PySpark: multiple conditions in when clause

后端 未结 4 2184
一生所求
一生所求 2020-12-01 00:46

I would like to modify the cell values of a dataframe column (Age) where currently it is blank and I would only do it if another column (Survived) has the value 0 for the c

4条回答
  •  渐次进展
    2020-12-01 01:25

    It should be:

    $when(((tdata.Age == "" ) & (tdata.Survived == "0")), mean_age_0)
    

提交回复
热议问题