<jupyter_start><jupyter_text>Exploring the Financial History Features in the Dataset<jupyter_code>import pandas as pd

import matplotlib.pyplot as plt #import plotting package

#render plotting automatically
%matplotlib inline

import matplotlib as mpl #additional plotting functionality

mpl.rcParams['figure.dpi'] = 400 #high resolution figures

import numpy as np
df = pd.read_csv('../../Data/Chapter_1_cleaned_data.csv')
df.head()
df.columns
df.shape
pay_feats = ['PAY_1', 'PAY_2', 'PAY_3', 'PAY_4', 'PAY_5', 'PAY_6']
df[pay_feats].describe()
df[pay_feats[0]].value_counts().sort_index()
pay_feats[0]
mpl.rcParams['figure.dpi'] = 400
mpl.rcParams['font.size'] = 12
df[pay_feats[0]].hist()
pay_1_bins = np.array(range(-2,10)) - 0.5
pay_1_bins
df[pay_feats[0]].hist(bins=pay_1_bins)
plt.xlabel('PAY_1')
plt.ylabel('Number of accounts')
for feat in pay_feats:
    print(df[feat].value_counts().sort_index())
mpl.rcParams['font.size'] = 4
df[pay_feats].hist(bins=pay_1_bins, layout=(2,3))
df.loc[df['PAY_2']==2, ['PAY_2', 'PAY_3']].head()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16573033707865167, 'fraction_numerical': 0.033707865168539325, 'mean_word_length': 6.977611940298507, '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': '423452', 'license': 'MIT', 'n_tokens_mistral': 460, 'n_tokens_neox': 429, 'n_words': 80, 'path': 'Chapter01/Example_Exploring_Financial_History/Exploring_financial_history.ipynb', 'repo_name': 'arifmudi/Data-Science-Projects-with-Python-Second-Ed', 'size': '1068'}