Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -193,6 +193,7 @@ def plot_global_map():
|
|
193 |
|
194 |
# Replace country codes with full country names
|
195 |
df['region'] = df['region'].map(country_mapping)
|
|
|
196 |
|
197 |
# Group by country and count the number of films
|
198 |
df_grouped = df.groupby('region').size().reset_index(name='total_films')
|
@@ -201,11 +202,11 @@ def plot_global_map():
|
|
201 |
df_grouped['log_total_films'] = np.log1p(df_grouped['total_films'])
|
202 |
|
203 |
# Create a choropleth map with the log-transformed data
|
204 |
-
fig = px.choropleth(locations=
|
205 |
locationmode='country names',
|
206 |
color=movies_per_country['numMovies'],
|
207 |
-
hover_name=movies_per_country['
|
208 |
-
color_continuous_scale='
|
209 |
title='Total Number of Movies by Country')
|
210 |
|
211 |
# Update layout for title and other attributes
|
|
|
193 |
|
194 |
# Replace country codes with full country names
|
195 |
df['region'] = df['region'].map(country_mapping)
|
196 |
+
|
197 |
|
198 |
# Group by country and count the number of films
|
199 |
df_grouped = df.groupby('region').size().reset_index(name='total_films')
|
|
|
202 |
df_grouped['log_total_films'] = np.log1p(df_grouped['total_films'])
|
203 |
|
204 |
# Create a choropleth map with the log-transformed data
|
205 |
+
fig = px.choropleth(locations=df_grouped['region'],
|
206 |
locationmode='country names',
|
207 |
color=movies_per_country['numMovies'],
|
208 |
+
hover_name=movies_per_country['region'],
|
209 |
+
color_continuous_scale='solar',
|
210 |
title='Total Number of Movies by Country')
|
211 |
|
212 |
# Update layout for title and other attributes
|