Spaces:
Runtime error
Runtime error
Upload 6 files
Browse files
eda.py
CHANGED
|
@@ -34,6 +34,7 @@ def runEDA():
|
|
| 34 |
df = pd.read_csv('flight_price_prediction.csv')
|
| 35 |
st.dataframe(df)
|
| 36 |
|
|
|
|
| 37 |
st.write('## Histogram Price')
|
| 38 |
fig = plt.figure(figsize=(15,5))
|
| 39 |
sns.histplot(df['price'], bins=20, kde=True).set(title='Price')
|
|
@@ -66,5 +67,24 @@ def runEDA():
|
|
| 66 |
st.write('From the bar plot above we can see that Late Night ticket average price is cheapest compared to other time. Meanwhile night and morning flight have the most expensive average price.')
|
| 67 |
st.markdown('---')
|
| 68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
if __name__ == '__main__':
|
| 70 |
runEDA()
|
|
|
|
| 34 |
df = pd.read_csv('flight_price_prediction.csv')
|
| 35 |
st.dataframe(df)
|
| 36 |
|
| 37 |
+
plt.style.use('default')
|
| 38 |
st.write('## Histogram Price')
|
| 39 |
fig = plt.figure(figsize=(15,5))
|
| 40 |
sns.histplot(df['price'], bins=20, kde=True).set(title='Price')
|
|
|
|
| 67 |
st.write('From the bar plot above we can see that Late Night ticket average price is cheapest compared to other time. Meanwhile night and morning flight have the most expensive average price.')
|
| 68 |
st.markdown('---')
|
| 69 |
|
| 70 |
+
plt.style.use('dark_background')
|
| 71 |
+
fig = plt.figure(figsize=(20,8))
|
| 72 |
+
sns.lineplot(data=df, x='duration', y='price', hue='class', palette='hls')
|
| 73 |
+
plt.title('Ticket Price Versus Flight Duration Based on Class',fontsize=20)
|
| 74 |
+
plt.xlabel('Duration', fontsize=15)
|
| 75 |
+
plt.ylabel('Price', fontsize=15)
|
| 76 |
+
st.pyplot(fig)
|
| 77 |
+
st.write('Based on the line graph above, we can see that as the flight duration increase the ticket price is also increases in both the Economy and Business classes')
|
| 78 |
+
st.markdown('---')
|
| 79 |
+
|
| 80 |
+
fig = plt.figure(figsize=(20,8))
|
| 81 |
+
sns.lineplot(data=df, x='days_left', y='price', color='blue')
|
| 82 |
+
plt.title('Days Left For Departure Versus Ticket Price',fontsize=20)
|
| 83 |
+
plt.xlabel('Days Left for Departure',fontsize=15)
|
| 84 |
+
plt.ylabel('Price',fontsize=15)
|
| 85 |
+
st.pyplot(fig)
|
| 86 |
+
st.write('Based on the line graph above, we can see that as the flight duration increase the ticket price is also increases in both the Economy and Business classes')
|
| 87 |
+
st.markdown('---')
|
| 88 |
+
|
| 89 |
if __name__ == '__main__':
|
| 90 |
runEDA()
|