<jupyter_start><jupyter_text>0. load dataset<jupyter_code>import numpy as np 

import pandas as pd 

import matplotlib.pyplot as plt 

df_missing = pd.read_excel("Sample - Superstore.xls",sheet_name="Missing") 
df_missing.head()<jupyter_output><empty_output><jupyter_text>1. Fill all missing values with the string FILL<jupyter_code>df_missing.fillna('FILL')<jupyter_output><empty_output><jupyter_text>2. Fill in the specified columns with the string FILL<jupyter_code>df_missing[['Customer','Product']].fillna('FILL')<jupyter_output><empty_output><jupyter_text>3. Fill in the values using pad or backfill<jupyter_code>df_missing['Sales'].fillna(method='ffill')<jupyter_output><empty_output><jupyter_text>4. Use bfill to fill backward<jupyter_code>df_missing['Sales'].fillna(method='bfill')<jupyter_output><empty_output><jupyter_text>5.You can also fill by using a function average of DataFrames.<jupyter_code>df_missing['Sales'].fillna(df_missing.mean()['Sales'])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1267605633802817, 'fraction_numerical': 0.006036217303822937, 'mean_word_length': 10.705882352941176, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, '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': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '21213', 'license': 'MIT', 'n_tokens_mistral': 368, 'n_tokens_neox': 359, 'n_words': 58, 'path': 'Chapter04/.ipynb_checkpoints/Exercise 52-checkpoint.ipynb', 'repo_name': 'arifmudi/The-Data-Wrangling-Workshop', 'size': '994'}