cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
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

cfregly
Contributor

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

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now