Spaces:
Running
Running
Commit ·
eec4d7a
1
Parent(s): 90f7110
color by rank
Browse files
app.py
CHANGED
|
@@ -116,8 +116,9 @@ def full_report():
|
|
| 116 |
title='Average Jumps per Daily Session',
|
| 117 |
template="plotly_dark")
|
| 118 |
|
|
|
|
| 119 |
total_map = px.choropleth(country_df, locations="iso",
|
| 120 |
-
color="
|
| 121 |
hover_name="country", # column to add to hover information
|
| 122 |
color_continuous_scale ="YlOrRd",
|
| 123 |
projection='natural earth',
|
|
@@ -130,8 +131,8 @@ def full_report():
|
|
| 130 |
county_df['county'] = county_df['city'].map(city_county_map)
|
| 131 |
county_df['count_name'] = county_df['city'].map(city_county_name_map)
|
| 132 |
county_df = county_df.groupby(['county', 'count_name']).sum().reset_index()
|
| 133 |
-
|
| 134 |
-
county_map = px.choropleth(county_df, geojson=counties, locations='county', color='
|
| 135 |
color_continuous_scale="YlOrRd",
|
| 136 |
scope="usa",
|
| 137 |
hover_name="count_name",
|
|
|
|
| 116 |
title='Average Jumps per Daily Session',
|
| 117 |
template="plotly_dark")
|
| 118 |
|
| 119 |
+
country_df['rank'] = country_df['jumps'].rank(ascending=False)
|
| 120 |
total_map = px.choropleth(country_df, locations="iso",
|
| 121 |
+
color="rank",
|
| 122 |
hover_name="country", # column to add to hover information
|
| 123 |
color_continuous_scale ="YlOrRd",
|
| 124 |
projection='natural earth',
|
|
|
|
| 131 |
county_df['county'] = county_df['city'].map(city_county_map)
|
| 132 |
county_df['count_name'] = county_df['city'].map(city_county_name_map)
|
| 133 |
county_df = county_df.groupby(['county', 'count_name']).sum().reset_index()
|
| 134 |
+
county_df['rank'] = county_df['jumps'].rank(ascending=False)
|
| 135 |
+
county_map = px.choropleth(county_df, geojson=counties, locations='county', color='rank',
|
| 136 |
color_continuous_scale="YlOrRd",
|
| 137 |
scope="usa",
|
| 138 |
hover_name="count_name",
|