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

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group