cluster_network: fix focus_weights for mult sync

This commit is contained in:
Fabian Neumann 2019-11-07 16:54:09 +01:00 committed by GitHub
parent 47d4882593
commit 7df2b76f9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)