File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -971,6 +971,8 @@ def plot_samples_interactive_map(
971971 fill_value = 0 ,
972972 )
973973
974+ taxa = df_pivot .columns .dropna ().sort_values ().unique ()
975+
974976 # Append aggregations to pivot.
975977 df_location_aggs = df_samples .groupby (location_composite_key ).agg (
976978 {
@@ -1015,7 +1017,6 @@ def plot_samples_interactive_map(
10151017 samples_map .layout .width = width
10161018
10171019 # Add markers.
1018- count_factors = df_samples [count_by ].dropna ().sort_values ().unique ()
10191020 for _ , row in df_pivot .reset_index ().iterrows ():
10201021 title = (
10211022 f"Location: { row .location } ({ row .latitude :.3f} , { row .longitude :.3f} )"
@@ -1028,13 +1029,13 @@ def plot_samples_interactive_map(
10281029 title += f"\n Contributors: { row .contributor } "
10291030 title += "\n No. specimens: "
10301031 all_n = 0
1031- for factor in count_factors :
1032+ for taxon in taxa :
10321033 # Get the number of samples in this taxon
1033- n = row [factor ]
1034+ n = int ( row [taxon ])
10341035 # Count the number of samples in all taxa
10351036 all_n += n
10361037 if n > 0 :
1037- title += f"{ n } { factor } ; "
1038+ title += f"{ n } { taxon } ; "
10381039 # Only show a marker when there are enough samples
10391040 if all_n >= min_samples :
10401041 marker = ipyleaflet .Marker (
You can’t perform that action at this time.
0 commit comments