From 7df2b76f9daeb8d2775b833edf486c770e46c682 Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Thu, 7 Nov 2019 16:54:09 +0100 Subject: [PATCH] cluster_network: fix focus_weights for mult sync --- scripts/cluster_network.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cluster_network.py b/scripts/cluster_network.py index 416096ff..d01f17ec 100644 --- a/scripts/cluster_network.py +++ b/scripts/cluster_network.py @@ -169,7 +169,7 @@ def distribute_clusters(n, n_clusters, focus_weights=None, solver_name=None): assert total_focus <= 1.0, "The sum of focus weights must be less than or equal to 1." for country, weight in focus_weights.items(): - L[country] = weight + L[country] = weight / len(L[country]) remainder = [c not in focus_weights.keys() for c in L.index.get_level_values('country')] L[remainder] = L.loc[remainder].pipe(normed) * (1 - total_focus)