Skip to content

Instantly share code, notes, and snippets.

@ian-whitestone
Created September 14, 2018 18:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ian-whitestone/bf4ac239fcde4f2d37081e5ac05f9018 to your computer and use it in GitHub Desktop.
Save ian-whitestone/bf4ac239fcde4f2d37081e5ac05f9018 to your computer and use it in GitHub Desktop.
Pandas missing values summary
# Source: https://towardsdatascience.com/a-data-science-for-good-machine-learning-project-walk-through-in-python-part-one-1977dd701dbc
import pandas as pd
# Number of missing in each column
missing = pd.DataFrame(data.isnull().sum()).rename(columns = {0: 'total'})
# Create a percentage missing
missing['percent'] = missing['total'] / len(data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment