analist commited on
Commit
3e96981
·
verified ·
1 Parent(s): a90f379

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -11
app.py CHANGED
@@ -11,17 +11,18 @@ geojson_data = json.load(open(geojson_file_path, "r"))
11
  # Read the GeoJSON file using geopandas
12
  gdf = gpd.read_file(geojson_file_path)
13
 
14
- new_df = pd.read_csv('new_df.csv')
15
 
16
- fig = px.choropleth(
17
- new_df,
18
- locations="quartier_id",
19
- geojson=geojson_data,
20
- color="scores",
21
- hover_name="quartier",
22
- hover_data=["scores"],
23
- title="Score Sanitaire au Togo",
24
- )
25
- fig.update_geos(fitbounds="locations")
 
26
 
27
  st.plotly_chart(fig)
 
11
  # Read the GeoJSON file using geopandas
12
  gdf = gpd.read_file(geojson_file_path)
13
 
14
+ gdf_merged_q = pd.read_csv('merged_q.csv')
15
 
16
+ fig = px.choropleth_mapbox(gdf_merged_q,
17
+ geojson=geojson,
18
+ locations=gdf_merged_q.index,
19
+ color='scores',
20
+ mapbox_style="carto-positron",
21
+ title="Scores de Propreté Pour Les Préfectures Du Togo",
22
+ hover_name="adm2nm",
23
+ color_continuous_scale="Viridis"
24
+ )
25
+ fig.update_layout(margin={'r':0, 't':0, "l": 0, 'r': 0})
26
+ fig.show()
27
 
28
  st.plotly_chart(fig)