eaglelandsonce commited on
Commit
a629488
Β·
verified Β·
1 Parent(s): c858d1f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -5
app.py CHANGED
@@ -6,7 +6,6 @@ from datasets import load_dataset
6
  import folium
7
  from streamlit_folium import st_folium
8
  from geopy.geocoders import Nominatim
9
- from shadcn.ui import Card, CardContent, Button
10
 
11
  # Initialize geolocator
12
  geolocator = Nominatim(user_agent="geoapiExercises")
@@ -164,14 +163,20 @@ def recommend_deployment(data):
164
  if data.empty:
165
  return "No viable deployment regions within the specified parameters."
166
  best_region = data.loc[data["Composite Score"].idxmax()]
167
- return f"Recommended Region: {best_region['Region']} with Composite Score: {best_region['Composite Score']:.2f}, Signal Strength: {best_region['Signal Strength (dBm)']} dBm, Terrain Difficulty: {best_region['Terrain Difficulty (0-10)']}, Climate Risk: {best_region['Climate Risk (0-10)']}, and Estimated Cost: ${best_region['Cost ($1000s)']}k\nDescription: {best_region['Description']}\nLocation Name: {best_region.get('Location Name', 'N/A')}"
 
 
 
 
 
 
 
168
 
169
  recommendation = recommend_deployment(filtered_data)
170
 
171
- # Display Recommendation in a Card
172
  st.markdown("### 🌟 Final Recommendation")
173
- with st.container():
174
- st.markdown(f"**{recommendation}**")
175
 
176
  # Footer
177
  st.sidebar.markdown("---")
 
6
  import folium
7
  from streamlit_folium import st_folium
8
  from geopy.geocoders import Nominatim
 
9
 
10
  # Initialize geolocator
11
  geolocator = Nominatim(user_agent="geoapiExercises")
 
163
  if data.empty:
164
  return "No viable deployment regions within the specified parameters."
165
  best_region = data.loc[data["Composite Score"].idxmax()]
166
+ return f"**Recommended Region:** {best_region['Region']} \n" \
167
+ f"**Composite Score:** {best_region['Composite Score']:.2f} \n" \
168
+ f"**Signal Strength:** {best_region['Signal Strength (dBm)']} dBm \n" \
169
+ f"**Terrain Difficulty:** {best_region['Terrain Difficulty (0-10)']} \n" \
170
+ f"**Climate Risk:** {best_region['Climate Risk (0-10)']} \n" \
171
+ f"**Estimated Cost:** ${best_region['Cost ($1000s)']}k \n" \
172
+ f"**Description:** {best_region['Description']} \n" \
173
+ f"**Location Name:** {best_region.get('Location Name', 'N/A')}"
174
 
175
  recommendation = recommend_deployment(filtered_data)
176
 
177
+ # Display Recommendation
178
  st.markdown("### 🌟 Final Recommendation")
179
+ st.markdown(recommendation)
 
180
 
181
  # Footer
182
  st.sidebar.markdown("---")