Skip to content

Instantly share code, notes, and snippets.

@manualbashing
Last active November 6, 2019 12:31
Show Gist options
  • Select an option

  • Save manualbashing/8313cf1a55fbb412de4fe172417eb02f to your computer and use it in GitHub Desktop.

Select an option

Save manualbashing/8313cf1a55fbb412de4fe172417eb02f to your computer and use it in GitHub Desktop.
[Missing values statistics for a pandas dataframe] #Pandas
def missing_values_count(df_train):
tbl = []
for col in df_train.columns[df_train.isnull().any()]:
tbl.append([col, df_train[col].isnull().sum()])
return pd.DataFrame(tbl, columns=["column", "missing_values_count"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment