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

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!