From 989495ce79693d1c1b41bb095f6c2b3340f6127b Mon Sep 17 00:00:00 2001 From: Tom Brown Date: Wed, 21 Oct 2020 14:31:37 +0200 Subject: [PATCH] prepare_sector_network: Type of new busmap index and values to str Otherwise they're read in as integers and the mapping fails. --- scripts/prepare_sector_network.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index a5221bee..df299d20 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -69,8 +69,12 @@ def update_wind_solar_costs(n,costs): #assign clustered bus #map initial network -> simplified network busmap_s = pd.read_csv(snakemake.input.busmap_s, index_col=0).squeeze() + busmap_s.index = busmap_s.index.astype(str) + busmap_s = busmap_s.astype(str) #map simplified network -> clustered network busmap = pd.read_csv(snakemake.input.busmap, index_col=0).squeeze() + busmap.index = busmap.index.astype(str) + busmap = busmap.astype(str) #map initial network -> clustered network clustermaps = busmap_s.map(busmap)