diff --git a/scripts/cluster_network.py b/scripts/cluster_network.py index 7572d3b3e..d5d27ef72 100644 --- a/scripts/cluster_network.py +++ b/scripts/cluster_network.py @@ -424,7 +424,10 @@ def clustering_for_n_clusters( n.links.eval("underwater_fraction * length").div(nc.links.length).dropna() ) nc.links["capital_cost"] = nc.links["capital_cost"].add( - (nc.links.length - n.links.length).clip(lower=0).mul(extended_link_costs), + (nc.links.length - n.links.length) + .clip(lower=0) + .mul(extended_link_costs) + .dropna(), fill_value=0, )