Skip to content

Instantly share code, notes, and snippets.

@terrah27
Last active March 11, 2022 23:17
Show Gist options
  • Save terrah27/36a352e9ff2c680a32674ebf663613e1 to your computer and use it in GitHub Desktop.
Save terrah27/36a352e9ff2c680a32674ebf663613e1 to your computer and use it in GitHub Desktop.
# find percent of columns with missing values and compare to total number of columns
cols_missing_vals = len(missing_values_list)
df_cols = df.shape[1]
print(f'Columns With Missing Values: {cols_missing_vals}')
print(f'Total Columns: {df_cols}')
print(f'Percent of Columns with Missing Values: {round(cols_missing_vals/df_cols*100,1)}%')
>>> Columns With Missing Values: 67
>>> Total Columns: 122
>>> Percent of Columns with Missing Values: 54.9%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment