fschwartzer commited on
Commit
fd31ef9
1 Parent(s): 02bd7e7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -71,9 +71,11 @@ with st.sidebar:
71
  # Filter data based on the radius
72
  if selected_coords == 'Custom':
73
  filtered_data = data[data.apply(lambda x: calculate_distance(x['latitude'], x['longitude'], custom_lat, custom_lon), axis=1) <= radius_in_meters]
 
74
  else:
75
  filtered_data = data
76
 
 
77
  # Add a custom CSS class to the map container
78
  st.markdown(f"""<style>
79
  .map {{
@@ -116,7 +118,8 @@ if selected_coords == 'Custom' and radius_visible:
116
 
117
  # Display the map and filtered_data
118
  with st.container():
119
- st.map(filtered_data, zoom=zoom_level, use_container_width=True)
 
120
 
121
  # Display the predicted Vunit values if applicable
122
  if 'Predicted_Vunit' in filtered_data.columns:
 
71
  # Filter data based on the radius
72
  if selected_coords == 'Custom':
73
  filtered_data = data[data.apply(lambda x: calculate_distance(x['latitude'], x['longitude'], custom_lat, custom_lon), axis=1) <= radius_in_meters]
74
+ filtered_data = filtered_data.dropna() # Drop rows with NaN values
75
  else:
76
  filtered_data = data
77
 
78
+
79
  # Add a custom CSS class to the map container
80
  st.markdown(f"""<style>
81
  .map {{
 
118
 
119
  # Display the map and filtered_data
120
  with st.container():
121
+ if selected_coords == 'Custom':
122
+ st.map(filtered_data, zoom=zoom_level, use_container_width=True)
123
 
124
  # Display the predicted Vunit values if applicable
125
  if 'Predicted_Vunit' in filtered_data.columns: