pandas how to drop a row where all values are nan code example
Example 1: python remove nan rows
df = df[df['my_var'].notna()]
Example 2: Returns a new DataFrame omitting rows with null values
# Returns a new DataFrame omitting rows with null values
df4.na.drop().show()
# +---+------+-----+
# |age|height| name|
# +---+------+-----+
# | 10| 80|Alice|
# +---+------+-----+