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

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.