<jupyter_start><jupyter_text>Tratamento de Nulos<jupyter_code>import pandas as pd
import numpy as np
df = pd.DataFrame([(0.0, np.nan, -1.0, 1.0),
                   (np.nan, 2.0, np.nan, np.nan),
                   (2.0, 3.0, np.nan, 9.0),
                   (np.nan, 4.0, -4.0, 16.0)],
                  columns=list('abcd'))
df<jupyter_output><empty_output><jupyter_text>Fill Value<jupyter_code>fill_value = df.b.mean()
df.b = df.b.fillna(fill_value)
df<jupyter_output><empty_output><jupyter_text>Drop<jupyter_code>df.dropna(subset=['a'])<jupyter_output><empty_output><jupyter_text>Interpolate<jupyter_code>df.interpolate(method='linear', limit_direction='forward', axis=0)<jupyter_output><empty_output><jupyter_text>Forward/Backward Filling<jupyter_code>df
#method={'backfill', 'bfill', 'pad', 'ffill'}
df.fillna(method='bfill')
df.fillna(method='ffill')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17361894024802707, 'fraction_numerical': 0.02480270574971815, 'mean_word_length': 4.92, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '527230', 'license': 'MIT', 'n_tokens_mistral': 378, 'n_tokens_neox': 364, 'n_words': 43, 'path': '02_Tratamento de Dados/tratamento_nulos.ipynb', 'repo_name': 'italo013/Data-Wrangling-e-Data-Cleaning', 'size': '887'}