Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -27,7 +27,10 @@ def load_data(url):
|
|
27 |
how="inner"
|
28 |
)
|
29 |
|
30 |
-
#
|
|
|
|
|
|
|
31 |
print("Columns in merged data:", merged_data.columns)
|
32 |
|
33 |
return merged_data
|
@@ -44,11 +47,12 @@ def plot_map(df, center):
|
|
44 |
|
45 |
# Add school locations
|
46 |
for idx, row in df.iterrows():
|
47 |
-
|
|
|
48 |
folium.Marker(
|
49 |
location=[row["latitude"], row["longitude"]],
|
50 |
popup=(
|
51 |
-
f"School Name: {
|
52 |
f"Download Speed: {row['download_speed']} Mbps<br>"
|
53 |
f"Upload Speed: {row['upload_speed']} Mbps<br>"
|
54 |
f"Latency: {row['latency']} ms"
|
|
|
27 |
how="inner"
|
28 |
)
|
29 |
|
30 |
+
# Strip whitespace from all column names
|
31 |
+
merged_data.columns = merged_data.columns.str.strip()
|
32 |
+
|
33 |
+
# Print columns to check the available columns in the data
|
34 |
print("Columns in merged data:", merged_data.columns)
|
35 |
|
36 |
return merged_data
|
|
|
47 |
|
48 |
# Add school locations
|
49 |
for idx, row in df.iterrows():
|
50 |
+
school_name = row.get("school_name", "No Name Provided") # Ensure correct column access
|
51 |
+
|
52 |
folium.Marker(
|
53 |
location=[row["latitude"], row["longitude"]],
|
54 |
popup=(
|
55 |
+
f"School Name: {school_name}<br>"
|
56 |
f"Download Speed: {row['download_speed']} Mbps<br>"
|
57 |
f"Upload Speed: {row['upload_speed']} Mbps<br>"
|
58 |
f"Latency: {row['latency']} ms"
|