Gigisghifari commited on
Commit
de5db35
1 Parent(s): 966629c

Upload eda.py

Browse files
Files changed (1) hide show
  1. eda.py +21 -0
eda.py CHANGED
@@ -58,18 +58,28 @@ def run():
58
  fig = plt.figure(figsize=[15,5])
59
  sns.scatterplot(x = 'limit_balance', y = 'age', hue= 'default', data = data)
60
  st.pyplot(fig)
 
 
 
61
 
62
  # Membuat barplot (EDA 3)
63
  st.write('### barchart of marital status and limit balance')
64
  fig = plt.figure(figsize=[15,5])
65
  sns.barplot(data=data, x='marital_status', y='limit_balance',)
66
  st.pyplot(fig)
 
 
 
 
67
 
68
  # Membuat pie chart (EDA 4)
69
  st.write('### pie chart of if a customer has defaulted')
70
  fig = plt.figure(figsize=(15,5))
71
  data['default'].value_counts().plot(kind='pie', autopct='%.2f%%')
72
  st.pyplot(fig)
 
 
 
73
 
74
  # Membuat line chart (EDA 5)
75
  st.write('### age of defaulting customer')
@@ -77,12 +87,20 @@ def run():
77
  fig, ax = plt.subplots(figsize=[15, 5])
78
  Def_Age.plot(kind='line', ax=ax)
79
  st.pyplot(fig)
 
 
 
80
 
81
  # Membuat bar chart (EDA 6)
82
  st.write('### The amount of education level')
83
  fig = plt.figure(figsize=[15,5])
84
  data['education_level'].value_counts().plot(kind='bar')
85
  st.pyplot(fig)
 
 
 
 
 
86
 
87
  # Membuat line chart (EDA7)
88
  st.write('### limit balance of gender')
@@ -90,6 +108,9 @@ def run():
90
  fig, ax = plt.subplots(figsize=[15, 5])
91
  Sex_Bal.plot(kind='line', ax=ax)
92
  st.pyplot(fig)
 
 
 
93
 
94
  if __name__ == '__main__':
95
  run()
 
58
  fig = plt.figure(figsize=[15,5])
59
  sns.scatterplot(x = 'limit_balance', y = 'age', hue= 'default', data = data)
60
  st.pyplot(fig)
61
+ st.write('Keterangan default customer:')
62
+ st.write('0 = no (customer tidak melakukan default)')
63
+ st.write('1 = yes (customer melakukan default)')
64
 
65
  # Membuat barplot (EDA 3)
66
  st.write('### barchart of marital status and limit balance')
67
  fig = plt.figure(figsize=[15,5])
68
  sns.barplot(data=data, x='marital_status', y='limit_balance',)
69
  st.pyplot(fig)
70
+ st.write('Keterangan marital status:')
71
+ st.write('1 = married')
72
+ st.write('2 = single ')
73
+ st.write('3 = others')
74
 
75
  # Membuat pie chart (EDA 4)
76
  st.write('### pie chart of if a customer has defaulted')
77
  fig = plt.figure(figsize=(15,5))
78
  data['default'].value_counts().plot(kind='pie', autopct='%.2f%%')
79
  st.pyplot(fig)
80
+ st.write('Keterangan default customer:')
81
+ st.write('0 = no (customer tidak melakukan default)')
82
+ st.write('1 = yes (customer melakukan default)')
83
 
84
  # Membuat line chart (EDA 5)
85
  st.write('### age of defaulting customer')
 
87
  fig, ax = plt.subplots(figsize=[15, 5])
88
  Def_Age.plot(kind='line', ax=ax)
89
  st.pyplot(fig)
90
+ st.write('Keterangan default customer:')
91
+ st.write('0 = no (customer tidak melakukan default)')
92
+ st.write('1 = yes (customer melakukan default)')
93
 
94
  # Membuat bar chart (EDA 6)
95
  st.write('### The amount of education level')
96
  fig = plt.figure(figsize=[15,5])
97
  data['education_level'].value_counts().plot(kind='bar')
98
  st.pyplot(fig)
99
+ st.write('Keterangan education level:')
100
+ st.write('1 = graduate school')
101
+ st.write('2 = university')
102
+ st.write('3 = high school')
103
+ st.write('4 = others')
104
 
105
  # Membuat line chart (EDA7)
106
  st.write('### limit balance of gender')
 
108
  fig, ax = plt.subplots(figsize=[15, 5])
109
  Sex_Bal.plot(kind='line', ax=ax)
110
  st.pyplot(fig)
111
+ st.write('Keterangan gender/sex:')
112
+ st.write('1 = male ')
113
+ st.write('2 = female')
114
 
115
  if __name__ == '__main__':
116
  run()