mukhlishr commited on
Commit
7ee9d9c
1 Parent(s): a27def2

Update eda.py

Browse files
Files changed (1) hide show
  1. eda.py +7 -10
eda.py CHANGED
@@ -34,17 +34,15 @@ def run():
34
 
35
  # Barplot booking status
36
  st.write('###### Status Cancel Reservation')
37
- fig, ax=plt.subplots(figsize=(10,5))
38
- sns.barplot(x=df['booking_status'].value_counts().index, y=df['booking_status'].value_counts())
39
- plt.xticks(rotation='vertical')
40
- plt.title('Barplot')
41
- plt.show()
42
  st.pyplot(fig)
43
 
 
44
  # Barplot segmented market
45
  st.write('###### Source of reservation')
46
  fig=plt.figure(figsize=(15,5))
47
- sns.barplot(x=df['market_segment_type'].value_counts().index, y=df['market_segment_type'].value_counts())
48
  st.pyplot(fig)
49
 
50
  # Barplot price room
@@ -53,13 +51,13 @@ def run():
53
  labels =[1,2,3]
54
  df['binned_price'] = pd.cut(df['avg_price_per_room'], bins,labels=labels).astype(int)
55
  fig=plt.figure(figsize=(15,5))
56
- sns.barplot(x=df['binned_price'].value_counts().index, y=df['binned_price'].value_counts())
57
  st.pyplot(fig)
58
 
59
  # Barplot type room
60
  st.write('###### Room type reserved')
61
  fig=plt.figure(figsize=(15,5))
62
- sns.barplot(x=df['room_type_reserved'].value_counts().index, y=df['room_type_reserved'].value_counts())
63
  st.pyplot(fig)
64
 
65
  # Barplot lead time
@@ -69,10 +67,9 @@ def run():
69
  labels =[1,2,3,4,5,6]
70
  df['binned_lead_time'] = pd.cut(df['lead_time'], bins,labels=labels).astype(int)
71
  fig=plt.figure(figsize=(15,5))
72
- sns.barplot(x=df['binned_lead_time'].value_counts().index, y=df['binned_lead_time'].value_counts())
73
  st.pyplot(fig)
74
 
75
-
76
 
77
 
78
  if __name__ == '__main__':
 
34
 
35
  # Barplot booking status
36
  st.write('###### Status Cancel Reservation')
37
+ fig=plt.figure(figsize=(15,5))
38
+ sns.countplot(x='booking_status', data = df)
 
 
 
39
  st.pyplot(fig)
40
 
41
+
42
  # Barplot segmented market
43
  st.write('###### Source of reservation')
44
  fig=plt.figure(figsize=(15,5))
45
+ sns.countplot(x='market_segment_type', data = df)
46
  st.pyplot(fig)
47
 
48
  # Barplot price room
 
51
  labels =[1,2,3]
52
  df['binned_price'] = pd.cut(df['avg_price_per_room'], bins,labels=labels).astype(int)
53
  fig=plt.figure(figsize=(15,5))
54
+ sns.countplot(x='binned_price', data = df)
55
  st.pyplot(fig)
56
 
57
  # Barplot type room
58
  st.write('###### Room type reserved')
59
  fig=plt.figure(figsize=(15,5))
60
+ sns.countplot(x='room_type_reserved', data = df)
61
  st.pyplot(fig)
62
 
63
  # Barplot lead time
 
67
  labels =[1,2,3,4,5,6]
68
  df['binned_lead_time'] = pd.cut(df['lead_time'], bins,labels=labels).astype(int)
69
  fig=plt.figure(figsize=(15,5))
70
+ sns.countplot(x='binned_lead_time', data = df)
71
  st.pyplot(fig)
72
 
 
73
 
74
 
75
  if __name__ == '__main__':