Delete/Drop only the rows which has all values as NaN in pandas I have a Dataframe, i need to drop the rows which has all the values as NaN.

ID      Age    Gender
601     21       M
501     NaN      F
NaN     NaN      NaN


The resulting data frame should look like.

Id     Age    Gender
601     21      M
501    NaN      F


I used df.drop(axis = 0), this will delete the rows if there is even one NaN value in row. Is there a way to do as required?
The complete command is this:

df.dropna(axis = 0, how = 'all', inplace = True)


you must add inplace = True argument, if you want the dataframe to be actually updated. Alternatively, you would have to type:

df = df.dropna(axis = 0, how = 'all')


but that's less pythonic IMHO.