riu-rd commited on
Commit
5cf07fd
1 Parent(s): 142b37b

Fixed Bugs

Browse files
klimainsights/pages/__pycache__/biodiversity.cpython-311.pyc CHANGED
Binary files a/klimainsights/pages/__pycache__/biodiversity.cpython-311.pyc and b/klimainsights/pages/__pycache__/biodiversity.cpython-311.pyc differ
 
klimainsights/pages/biodiversity.py CHANGED
@@ -133,7 +133,8 @@ def update_bar(region, species_type, bio_switch, click_data):
133
  # if region == "Sea":
134
  # filtered_data = biodiversity_gdf[(biodiversity_gdf['area_type'].isin(['Sea']))].reset_index().drop(columns='index')
135
  # else:
136
- filtered_data = biodiversity_gdf[biodiversity_gdf['island_group'] == region].reset_index().drop(columns='index').sort_values(by=species_type, ascending=True)
 
137
 
138
  if species_type == "total_species":
139
  txt = "Total"
@@ -144,7 +145,7 @@ def update_bar(region, species_type, bio_switch, click_data):
144
  if click_data is not None:
145
  data = click_data['points'][0]['customdata'][0]
146
  else:
147
- data = filtered_data['name'][0]
148
 
149
  island_gdf = temp_melted_gdf[(temp_melted_gdf['name'].isin([data]) == True)].drop(columns=['geometry'])
150
  line_fig = px.line(island_gdf, x='decade', y='value',color='name')
 
133
  # if region == "Sea":
134
  # filtered_data = biodiversity_gdf[(biodiversity_gdf['area_type'].isin(['Sea']))].reset_index().drop(columns='index')
135
  # else:
136
+
137
+ filtered_data = biodiversity_gdf[biodiversity_gdf['island_group'] == region].sort_values(by=species_type, ascending=True).reset_index().drop(columns='index')
138
 
139
  if species_type == "total_species":
140
  txt = "Total"
 
145
  if click_data is not None:
146
  data = click_data['points'][0]['customdata'][0]
147
  else:
148
+ data = filtered_data['name'].iloc[-1]
149
 
150
  island_gdf = temp_melted_gdf[(temp_melted_gdf['name'].isin([data]) == True)].drop(columns=['geometry'])
151
  line_fig = px.line(island_gdf, x='decade', y='value',color='name')
plotly_interactions.ipynb CHANGED
@@ -490,6 +490,26 @@
490
  "biodiversity_gdf.head()"
491
  ]
492
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
493
  {
494
  "cell_type": "markdown",
495
  "metadata": {},
 
490
  "biodiversity_gdf.head()"
491
  ]
492
  },
493
+ {
494
+ "cell_type": "code",
495
+ "execution_count": null,
496
+ "metadata": {},
497
+ "outputs": [],
498
+ "source": [
499
+ "filtered_data = biodiversity_gdf[biodiversity_gdf['island_group'] == 'Luzon'].sort_values(by='total_species', ascending=True).reset_index().drop(columns='index')\n",
500
+ "filtered_data.head()"
501
+ ]
502
+ },
503
+ {
504
+ "cell_type": "code",
505
+ "execution_count": null,
506
+ "metadata": {},
507
+ "outputs": [],
508
+ "source": [
509
+ "data = filtered_data['name'].iloc[-1]\n",
510
+ "data\n"
511
+ ]
512
+ },
513
  {
514
  "cell_type": "markdown",
515
  "metadata": {},