Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,5 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
import pandas as pd
|
| 3 |
-
import plotly.express as px
|
| 4 |
|
| 5 |
# Load the Excel file into a DataFrame (adjust the file path accordingly)
|
| 6 |
df = pd.read_excel('Book1.xlsx')
|
|
@@ -28,14 +27,6 @@ def get_route_by_bus(bus_name):
|
|
| 28 |
else:
|
| 29 |
return "No route found for this bus."
|
| 30 |
|
| 31 |
-
# Function to plot bus statistics
|
| 32 |
-
def plot_bus_statistics():
|
| 33 |
-
bus_counts = df['Routes'].value_counts().reset_index()
|
| 34 |
-
bus_counts.columns = ['Route', 'Count']
|
| 35 |
-
|
| 36 |
-
fig = px.bar(bus_counts, x='Route', y='Count', title="Bus Count by Route")
|
| 37 |
-
st.plotly_chart(fig)
|
| 38 |
-
|
| 39 |
def main():
|
| 40 |
st.title("Dhaka Local Buses and Routes Finder")
|
| 41 |
|
|
@@ -65,10 +56,6 @@ def main():
|
|
| 65 |
st.write(f"- {row['Dhaka Local Buses']}: {clean_route(row['Routes'])}") # Clean routes before displaying
|
| 66 |
else:
|
| 67 |
st.write(f"No buses found for the location '**{location}**'.")
|
| 68 |
-
|
| 69 |
-
# Bus Statistics Section
|
| 70 |
-
st.header("Bus Statistics")
|
| 71 |
-
plot_bus_statistics()
|
| 72 |
|
| 73 |
if __name__ == "__main__":
|
| 74 |
-
main()
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import pandas as pd
|
|
|
|
| 3 |
|
| 4 |
# Load the Excel file into a DataFrame (adjust the file path accordingly)
|
| 5 |
df = pd.read_excel('Book1.xlsx')
|
|
|
|
| 27 |
else:
|
| 28 |
return "No route found for this bus."
|
| 29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
def main():
|
| 31 |
st.title("Dhaka Local Buses and Routes Finder")
|
| 32 |
|
|
|
|
| 56 |
st.write(f"- {row['Dhaka Local Buses']}: {clean_route(row['Routes'])}") # Clean routes before displaying
|
| 57 |
else:
|
| 58 |
st.write(f"No buses found for the location '**{location}**'.")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
|
| 60 |
if __name__ == "__main__":
|
| 61 |
+
main()
|