ardifarizky commited on
Commit
1454e13
1 Parent(s): 1c58500

Update eda.py

Browse files
Files changed (1) hide show
  1. eda.py +17 -0
eda.py CHANGED
@@ -29,7 +29,24 @@ def run():
29
  # #Show Dataframe
30
  # d = pd.read_csv('h8dsft_P1G3_Ardifa-Rizky-Saputra.csv')
31
  # st.dataframe(d)
 
32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  # st.write('#### scatterplot berdasarkan Input User')
34
  # pilihan1 = st.selectbox('Pilih column : ', ('age', 'creatinine_phosphokinase','ejection_fraction', 'platelets','serum_creatinine', 'serum_sodium', 'time'),key=1)
35
  # pilihan2 = st.selectbox('Pilih column : ', ('age', 'creatinine_phosphokinase','ejection_fraction', 'platelets','serum_creatinine', 'serum_sodium', 'time'),key=2)
 
29
  # #Show Dataframe
30
  # d = pd.read_csv('h8dsft_P1G3_Ardifa-Rizky-Saputra.csv')
31
  # st.dataframe(d)
32
+ fig, ax = plt.subplots(nrows=2, ncols=2, figsize=(12, 10))
33
 
34
+ sns.histplot(data=df, x='lead_time', hue='hotel', multiple='stack', bins=20, ax=ax[0, 0], palette='Set1')
35
+ axes[0, 0].set_title("Booking Behavior by Hotel Type (Lead Time)")
36
+
37
+ sns.barplot(data=df, x='hotel', y='is_canceled', ax=ax[0, 1], palette='Set1')
38
+ axes[0, 1].set_title("Cancellation Rate by Hotel Type")
39
+
40
+ sns.countplot(data=df, x='booking_changes', hue='hotel', ax=ax[1, 0], palette='Set1')
41
+ axes[1, 0].set_title("Booking Changes by Hotel Type")
42
+
43
+ sns.countplot(data=df, x='hotel', ax=ax[1, 1], palette='Set1')
44
+ axes[1, 1].set_title("Total Bookings by Hotel Type")
45
+
46
+
47
+ plt.tight_layout()
48
+
49
+ plt.show()
50
  # st.write('#### scatterplot berdasarkan Input User')
51
  # pilihan1 = st.selectbox('Pilih column : ', ('age', 'creatinine_phosphokinase','ejection_fraction', 'platelets','serum_creatinine', 'serum_sodium', 'time'),key=1)
52
  # pilihan2 = st.selectbox('Pilih column : ', ('age', 'creatinine_phosphokinase','ejection_fraction', 'platelets','serum_creatinine', 'serum_sodium', 'time'),key=2)