text_plain_output_1.png image_output_1.png
import matplotlib.pyplot as plt

import matplotlib.pyplot as plt

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

import seaborn as sns

import seaborn as sns

data = pd.read_csv('/kaggle/input/loan-prediction-based-on-customer-behavior/Training Data.csv')

import matplotlib.pyplot as plt
total = list(data.Risk_Flag.value_counts())
Flag0 = total[0]
Flag1 = total[1]

import seaborn as sns
g=sns.catplot(x='STATE', data=data, height=12, aspect=1.5, kind='count', palette='deep')
g.set_xticklabels(rotation=60)

import seaborn as sns
import matplotlib.pyplot as plt
plt.xticks(rotation=60)

data['Age_group'] = pd.qcut(data.Age, 5)
g = sns.FacetGrid(data=data, row='House_Ownership', col='Married/Single', height=5, aspect=1.5)
g.map_dataframe(sns.barplot, x='Age_group', y='Risk_Flag', ci=None)
g.set_xticklabels(rotation=60)