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 to remove empty rows from the data frame.

dhanunjaya
New Contributor II

lets assume if i have 10 columns in a data frame,all 10 columns has empty values for 100 rows out of 200 rows, how i can skip the empty rows?

6 REPLIES 6

dillon_bostwick
New Contributor II

dhanunjaya
New Contributor II

@dillon,

Drop will not help me in my case , i have a 200 rows in a table which has 100 rows as null and rest of rows has proper values .

searro
New Contributor II

Simply you can just use the .drop() function, which is available as part of DataFrameNaFunctions.

Malan_Francois_
New Contributor II

@searro , it would be nice to have a well-formed example.

bhuvanrjb
New Contributor II

How can we do this in Java.

I have a DataFrame with three columns, When all three values are null. Is there a way to delete that row in java?

GaryDiaz
New Contributor II

you can try this: df.na.drop(how = "all"), this will remove the row only if all the rows are null or NaN

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