• Databricks Community
  • Data Engineering
  • Re: How do I replace nulls with 0's in a DataFrame...

cfregly
cfregly
Contributor
Options
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Report Inappropriate Content

‎04-30-2015 03:00 PM

You can use the

DataFrame.na.fill()
method in Scala and the
DataFrame.fillna()
method in Python.

Here are the relevant links:

Scala:

https://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.sql.DataFrame

https://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.sql.DataFrameNaFunctions

Python:

http://spark.apache.org/docs/latest/api/python/pyspark.sql.html#pyspark.sql.DataFrame.fillna

0 Kudos
Reply
Powered by Khoros