From 92ddfbd3a5339c0a867997160365e3ad0bd0e0cd Mon Sep 17 00:00:00 2001 From: Ben RdO Date: Wed, 2 Nov 2022 13:34:40 -0700 Subject: [PATCH] fix: handle FutureWarning raised by pandas --- powersimdata/design/investment/investment_costs.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/powersimdata/design/investment/investment_costs.py b/powersimdata/design/investment/investment_costs.py index 0dc4ce3da..a4598c9e7 100644 --- a/powersimdata/design/investment/investment_costs.py +++ b/powersimdata/design/investment/investment_costs.py @@ -140,7 +140,9 @@ def get_branch_mult(x, bus_reg, ac_reg_mult, branch_lookup_alerted=set()): # Average the multipliers for branches (transformer regions should match) regions = (x.from_region, x.to_region) region_mults = ac_reg_mult.loc[ac_reg_mult.name_abbr.isin(regions)] - region_mults = region_mults.groupby(["kV", "MW"]).mean().reset_index() + region_mults = ( + region_mults.groupby(["kV", "MW"]).mean(numeric_only=True).reset_index() + ) mult_lookup_kV = region_mults.loc[ # noqa: N806 (region_mults.kV - max_kV).abs().idxmin()