<jupyter_start><jupyter_text>Importes<jupyter_code>import pandas as pd
import inflection<jupyter_output><empty_output><jupyter_text>Helper functions  Loading data<jupyter_code>df_sales_raw = pd.read_csv('data/train.csv', low_memory=False)
df_store_raw = pd.read_csv('data/store.csv', low_memory=False)

# merge 
df_raw = pd.merge(df_sales_raw, df_store_raw, how='left', on='Store')
df_raw.sample()<jupyter_output><empty_output><jupyter_text>Descrição dos dados<jupyter_code>df1 = df_raw.copy()
df1.columns
cols_old = ['Store', 'DayOfWeek', 'Date', 'Sales', 'Customers', 'Open', 'Promo',
            'StateHoliday', 'SchoolHoliday', 'StoreType', 'Assortment',
            'CompetitionDistance', 'CompetitionOpenSinceMonth',
            'CompetitionOpenSinceYear', 'Promo2', 'Promo2SinceWeek',
            'Promo2SinceYear', 'PromoInterval']

snakecase = lambda x: inflection.underscore(x)

# mapea a snakecase em todas as palavras de cols_old
cols_new = list(map(snakecase, cols_old))

# rename
df1.columns = cols_new
df1.columns<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1323251417769376, 'fraction_numerical': 0.006616257088846881, 'mean_word_length': 6.457746478873239, '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': '466025', 'license': 'MIT', 'n_tokens_mistral': 400, 'n_tokens_neox': 388, 'n_words': 64, 'path': 'rossmann_sale_prediction.ipynb', 'repo_name': 'PryskaS/rossmann-store-sale-prediction', 'size': '1058'}