Skip to content

Instantly share code, notes, and snippets.

@ChaitanyaBaweja
Created July 10, 2020 11:49
Show Gist options
  • Save ChaitanyaBaweja/db614d154f47ba81c5de5af909f69d0e to your computer and use it in GitHub Desktop.
Save ChaitanyaBaweja/db614d154f47ba81c5de5af909f69d0e to your computer and use it in GitHub Desktop.
# drop all rows with atleast one NaN
new_df = df.dropna(axis = 0, how ='any')
# drop all rows with all NaN
new_df = df.dropna(axis = 0, how ='all')
# drop all columns with atleast one NaN
new_df = df.dropna(axis = 1, how ='any')
# drop all columns with all NaN
new_df = df.dropna(axis = 1, how ='all')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment