QuestionQ230

VerifiedDeveloping Apache Spark™ DataFrame/DataSet API Applications

A DataFrame df contains null values in the salary column.

Which command replaces every null value in that column with 0?

Explanation

DataFrame.fillna() can take a dictionary that maps a column name to its replacement value. Mapping "salary" to 0 fills missing values in that column while leaving other columns unchanged.

Community Discussion

No comments yet. Be the first to start the discussion!