Skip to content

Instantly share code, notes, and snippets.

@EricSchles
Created January 8, 2019 01:12
Show Gist options
  • Save EricSchles/66b41f4a774e723ea3eff2b00f1505d1 to your computer and use it in GitHub Desktop.
Save EricSchles/66b41f4a774e723ea3eff2b00f1505d1 to your computer and use it in GitHub Desktop.
def get_percent_empty(df):
listing = list(df.isnull().sum()/df.shape[0] != 0)
columns_of_interest = []
cols = df.columns.tolist()
for index, col in enumerate(cols):
if listing[index]:
columns_of_interest.append(col)
return df[columns_of_interest].isnull().sum()/df.shape[0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment