File size: 668 Bytes
60a293b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import pandas as pd
import plotly.express as px
import json
import geopandas as gpd
import folium
from IPython.display import display

# Specify the path to your GeoJSON file
geojson_file_path = 'BNDA_TGO_2017-06-29_lastupdate.geojson'
geojson_data = json.load(open(geojson_file_path, "r"))
# Read the GeoJSON file using geopandas
gdf = gpd.read_file(geojson_file_path)

new_df = pd.read_csv('new_df.csv')

fig = px.choropleth(
    new_df,
    locations="quartier_id",
    geojson=geojson_data,
    color="scores",
    hover_name="quartier",
    hover_data=["scores"],
    title="Score Sanitaire au Togo",
)
fig.update_geos(fitbounds="locations")

st.plotly_chart(fig)