shukdevdatta123 commited on
Commit
3ed15d0
·
verified ·
1 Parent(s): c9e1f1e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -32
app.py CHANGED
@@ -10,36 +10,6 @@ required_columns = ['Origin', 'Destination', 'Fare (৳)']
10
  if not all(col in df.columns for col in required_columns):
11
  st.write("Please ensure the file contains 'Origin', 'Destination', and 'Fare' columns.")
12
  else:
13
- # Add coordinates for each station (example coordinates for illustration)
14
- coordinates = {
15
- "Uttara North": (23.869066, 90.367445),
16
- "Uttara Center": (23.860118, 90.365106),
17
- "Uttara South": (23.845934, 90.363175),
18
- "Pallabi": (23.82619516961383, 90.36481554252525),
19
- "Mirpur 11": (23.819438208310213, 90.36528532902963),
20
- "Mirpur 10": (23.808582994847285, 90.36821595330717),
21
- "Kazipara": (23.800017952100532, 90.37178261495391),
22
- "Shewrapara": (23.79070140857881, 90.37564622631841),
23
- "Agargaon": (23.778385546736345, 90.3800557456356),
24
- "Bijoy Sarani": (23.766638127271825, 90.38307537134754),
25
- "Farmgate": (23.75923604938459, 90.38694218434738),
26
- "Kawran Bazar": (23.751392319539104, 90.39275707447003),
27
- "Shahbagh": (23.740324209546923, 90.39600784811131),
28
- "Dhaka University": (23.732091083122114, 90.39659408796354),
29
- "Bangladesh Secretariat": (23.73004754106779, 90.40764881366906),
30
- "Motijheel": (23.72816566933198, 90.41923497972823),
31
- "Kamalapur": (23.732367758919807, 90.42547378971085)
32
- }
33
-
34
- # Add latitude and longitude for origin and destination based on the coordinates dictionary
35
- df['Origin_Lat'] = df['Origin'].map(lambda x: coordinates.get(x, (None, None))[0])
36
- df['Origin_Lon'] = df['Origin'].map(lambda x: coordinates.get(x, (None, None))[1])
37
- df['Destination_Lat'] = df['Destination'].map(lambda x: coordinates.get(x, (None, None))[0])
38
- df['Destination_Lon'] = df['Destination'].map(lambda x: coordinates.get(x, (None, None))[1])
39
-
40
- # Filter rows with missing coordinates
41
- df.dropna(subset=['Origin_Lat', 'Origin_Lon', 'Destination_Lat', 'Destination_Lon'], inplace=True)
42
-
43
  # Streamlit UI setup
44
  st.title("Dhaka Metro Rail Fare Checker 🚇")
45
  st.write("Below is the fare chart for Dhaka Metro Rail 💶:")
@@ -53,9 +23,9 @@ else:
53
  1. Select your **Location station** from the dropdown menu.
54
  2. Select your **destination(s)** by clicking the destination buttons.
55
  3. The fare from your location to the selected destination(s) will be displayed below.
56
- 4. You can also see the stations marked on a map.
57
 
58
- **Note:** The map highlights your location in green and destinations in blue.
59
 
60
  If you face any issues or need further assistance, feel free to [Contact Support on WhatsApp](https://wa.me/+8801719296601).
61
  """)
 
10
  if not all(col in df.columns for col in required_columns):
11
  st.write("Please ensure the file contains 'Origin', 'Destination', and 'Fare' columns.")
12
  else:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  # Streamlit UI setup
14
  st.title("Dhaka Metro Rail Fare Checker 🚇")
15
  st.write("Below is the fare chart for Dhaka Metro Rail 💶:")
 
23
  1. Select your **Location station** from the dropdown menu.
24
  2. Select your **destination(s)** by clicking the destination buttons.
25
  3. The fare from your location to the selected destination(s) will be displayed below.
26
+ 4. You can select multiple destinations to check the fares for all of them.
27
 
28
+ **Note:** Please select a valid origin station first.
29
 
30
  If you face any issues or need further assistance, feel free to [Contact Support on WhatsApp](https://wa.me/+8801719296601).
31
  """)