Spaces:
Runtime error
Runtime error
Update eda.py
Browse files
eda.py
CHANGED
@@ -33,30 +33,7 @@ def runEDA():
|
|
33 |
st.write('Based on the histogram plot, we can see that most of the flight having price less than 10k INR (Indian Rupee). But for few flight price is goes up to 120k INR, this probably the price of business class.')
|
34 |
st.markdown('---')
|
35 |
|
36 |
-
st.write('## Airlines Flights Count')
|
37 |
-
df_airlines = df.groupby(['airline']).agg(counts=('flight', 'count')).sort_values(by=['counts'], ascending=False)
|
38 |
-
fig, ax = plt.subplots(ncols=1, figsize=(15, 5))
|
39 |
-
ax.pie(df_airlines['counts'], labels=df_airlines['counts'].index, autopct='%.2f%%')
|
40 |
-
ax.set_title("Airlines Flight Count")
|
41 |
-
st.pyplot(fig)
|
42 |
-
st.write('The flight is dominated by `Vistara` Airlines with more than 127k flights. Their biggest competitor is `Air India` with 80k flights.')
|
43 |
-
st.markdown('---')
|
44 |
|
45 |
-
st.write('## Flight Stops/Transit Count')
|
46 |
-
df_stops = df.groupby(['stops']).agg(counts=('airline', 'count'))
|
47 |
-
fig, ax = plt.subplots(ncols=1, figsize=(15, 5))
|
48 |
-
ax.pie(df_stops['counts'], labels=df_stops['counts'].index, autopct='%.2f%%')
|
49 |
-
ax.set_title("Flight Stops (Transit) Count")
|
50 |
-
st.pyplot(fig)
|
51 |
-
st.write('Most of flight on this dataset is having one transit. Only 12% of the data that is a direct flight.')
|
52 |
-
st.markdown('---')
|
53 |
-
|
54 |
-
df_departure = df.groupby(['departure_time']).agg({'price':'mean'}).sort_values(by=['price'], ascending=True)
|
55 |
-
fig = plt.figure(figsize=(7, 5))
|
56 |
-
sns.barplot(data=df_departure, x=df_departure.index.to_list(), y='price', orient='v').set(title='Average price per Departure Time')
|
57 |
-
st.pyplot(fig)
|
58 |
-
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.')
|
59 |
-
st.markdown('---')
|
60 |
|
61 |
plt.style.use('dark_background')
|
62 |
fig = plt.figure(figsize=(20,8))
|
|
|
33 |
st.write('Based on the histogram plot, we can see that most of the flight having price less than 10k INR (Indian Rupee). But for few flight price is goes up to 120k INR, this probably the price of business class.')
|
34 |
st.markdown('---')
|
35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
plt.style.use('dark_background')
|
39 |
fig = plt.figure(figsize=(20,8))
|