<jupyter_start><jupyter_text>DATA PREPROCESSSING<jupyter_code>print('SEX ' + str(sorted(df['SEX'].unique())))
print('EDUCATION ' + str(sorted(df['EDUCATION'].unique())))
print('MARRIAGE ' + str(sorted(df['MARRIAGE'].unique())))
print('PAY_0 ' + str(sorted(df['PAY_0'].unique())))
print('default.payment.next.month ' + str(sorted(df['default payment next month'].unique())))
fill = (df.EDUCATION == 0) | (df.EDUCATION == 5) | (df.EDUCATION == 6)
df.loc[fill, 'EDUCATION'] = 4

print('EDUCATION ' + str(sorted(df['EDUCATION'].unique())))
fill = (df.MARRIAGE == 0)
df.loc[fill, 'MARRIAGE'] = 2

print('MARRIAGE ' + str(sorted(df['MARRIAGE'].unique())))
df = df.rename(columns={'default payment next month': 'DEFAULT', 
                        'PAY_0': 'PAY_1'})
df.head()
# Exercise 02
pd.crosstab(df.AGE,df.DEFAULT)
pd.crosstab(df.AGE,df.DEFAULT,normalize='index',margins=True)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.22430939226519336, 'fraction_numerical': 0.013259668508287293, 'mean_word_length': 6.306451612903226, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '317834', 'license': 'MIT', 'n_tokens_mistral': 375, 'n_tokens_neox': 356, 'n_words': 47, 'path': 'Exercise02/Exercise02.ipynb', 'repo_name': 'Develop-Packt/Interpreting-the-credit-card-defaulter-dataset', 'size': '905'}