cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I replace nulls with 0's in a DataFrame?

cfregly
Contributor
 
4 REPLIES 4

SiddarthaPaturu
New Contributor II

How Do I check if the column is null ,column is integer type

ManishTrivedi
New Contributor II

Spark version 2.1.0 returns following error:

 java.lang.NoSuchMethodError: org.apache.spark.sql.DataFrameNaFunctions.fill(JLscala/collection/Seq;)Lorg/apache/spark/sql/Dataset

GauravKhare
New Contributor II

df.na.replace(df.columns,Map("" -> "0")).show() // to convert from blank strings to zero