engralimalik commited on
Commit
eeed2d4
·
verified ·
1 Parent(s): 90a2425

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -19
app.py CHANGED
@@ -10,9 +10,9 @@ def load_data(url):
10
  # Request the file content
11
  response = requests.get(url)
12
 
13
- # Read the file content into a pandas dataframe
14
- lat_long_data = pd.read_excel(BytesIO(response.content), sheet_name="lat long")
15
- measurement_data = pd.read_excel(BytesIO(response.content), sheet_name="measurement data")
16
 
17
  # Merge data on school_id_giga
18
  merged_data = pd.merge(
@@ -50,19 +50,4 @@ def plot_map(df, center):
50
  # Add data center
51
  folium.Marker(
52
  location=[center[0][0], center[0][1]],
53
- popup="Proposed Data Center",
54
- icon=folium.Icon(color="red", icon="cloud")
55
- ).add_to(map)
56
- return map
57
-
58
- # Main function to run the application
59
- def main():
60
- url = "https://huggingface.co/spaces/engralimalik/lace/blob/main/data%20barbados.xlsx" # Replace with your actual file URL
61
- df = load_data(url)
62
- center = find_data_center(df)
63
- map = plot_map(df, center)
64
- map.save("index.html")
65
- print("Map has been saved as index.html.")
66
-
67
- if __name__ == "__main__":
68
- main()
 
10
  # Request the file content
11
  response = requests.get(url)
12
 
13
+ # Read the file content into a pandas dataframe with the engine specified
14
+ lat_long_data = pd.read_excel(BytesIO(response.content), sheet_name="lat long", engine='openpyxl')
15
+ measurement_data = pd.read_excel(BytesIO(response.content), sheet_name="measurement data", engine='openpyxl')
16
 
17
  # Merge data on school_id_giga
18
  merged_data = pd.merge(
 
50
  # Add data center
51
  folium.Marker(
52
  location=[center[0][0], center[0][1]],
53
+