Created
September 14, 2018 18:30
-
-
Save ian-whitestone/bf4ac239fcde4f2d37081e5ac05f9018 to your computer and use it in GitHub Desktop.
Pandas missing values summary
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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