<jupyter_start><jupyter_text>Pandas - Missing Data<jupyter_code>import numpy as np
import pandas as pd
d = {'A':[1,2,np.nan], 'B':[5, np.nan, np.nan], 'C':[1,2,3]}
df = pd.DataFrame(d)
df<jupyter_output><empty_output><jupyter_text>Dropping NA<jupyter_code>df.dropna()
df.dropna(axis=1)
df.dropna(thresh=2)<jupyter_output><empty_output><jupyter_text>Fill NA<jupyter_code>df.fillna(value='FILL VALUE')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1794871794871795, 'fraction_numerical': 0.018648018648018648, 'mean_word_length': 10.944444444444445, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '592028', 'license': 'MIT', 'n_tokens_mistral': 202, 'n_tokens_neox': 198, 'n_words': 24, 'path': 'Pandas/Filling Data.ipynb', 'repo_name': 'souviksaha97/Financial-Data-Analysis', 'size': '429'}