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

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

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]
plt.figure(figsize=(8, 8))
plt.pie([Flag0, Flag1], labels=['Non-Risk:\n%d total' % Flag0, 'Risk:\n%d total' % Flag1], autopct='%1.2f%%')