<jupyter_start><jupyter_text>Find total missing values in a dataset<jupyter_code>import numpy as np
import pandas as pd
df = pd.read_csv("WHO_obesityByCountry_2016.csv")
df.head()
# get the number of missing data points per column
missing_values_count = df.isnull().sum()

# how many total missing values do we have?
total_cells = np.product(df.shape)
total_missing = missing_values_count.sum()

# percent of data that is missing
percent_missing = (total_missing/total_cells) * 100
percent_missing<jupyter_output><empty_output><jupyter_text>------------------<jupyter_code>df.shape
missing_values_count = df.isnull().sum()
missing_values_count
total_missing = missing_values_count.sum()
total_missing
total_cells = np.product(df.shape)
total_cells<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11325611325611326, 'fraction_numerical': 0.009009009009009009, 'mean_word_length': 6.339622641509434, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '123024', 'license': 'CNRI-Python', 'n_tokens_mistral': 267, 'n_tokens_neox': 252, 'n_words': 59, 'path': '10_Missing_Values/1_Imputation_Pandas/5_Missing_Values_Percentage/3_Total_Missing_Values/Total_missing_values_in_dataset.ipynb', 'repo_name': 'sureshmecad/Pandas', 'size': '777'}