Skip to content

Commit bb95f1b

Browse files
committed
Reindexing change required for 2021 dataset
1 parent 0e512e0 commit bb95f1b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

echopop/analysis.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,17 +588,21 @@ def apportion_kriged_values(
588588
unaged_sexed_apportioned = unaged_proportions.merge(aged_unaged_sex_proportions)
589589
# ---- Set index to stratum column
590590
unaged_sexed_apportioned.set_index([stratum_col], inplace=True)
591+
# ---- Set the index based on `summed_abundance`
592+
summed_abundance_indexed = summed_abundance.reindex(unaged_sexed_apportioned.index)
591593
# ---- Append the stratum-aggregated abundance values
592594
unaged_sexed_apportioned["abundance_apportioned_unaged"] = (
593595
unaged_sexed_apportioned["weight_proportion"]
594596
* unaged_sexed_apportioned["weight_proportion_overall_unaged"]
595-
* summed_abundance
597+
* summed_abundance_indexed
596598
)
599+
# ---- Set the index based on `summed_biomass`
600+
summed_biomass_indexed = summed_biomass.reindex(unaged_sexed_apportioned.index)
597601
# ---- Append the stratum-aggregated biomass values
598602
unaged_sexed_apportioned["biomass_apportioned_unaged"] = (
599603
unaged_sexed_apportioned["weight_proportion"]
600604
* unaged_sexed_apportioned["weight_proportion_overall_unaged"]
601-
* summed_biomass
605+
* summed_biomass_indexed
602606
)
603607

604608
# Distribute biological values over the overall proportions (i.e. relative to aged and unaged

0 commit comments

Comments
 (0)