Open fhg-isi opened 4 days ago
When trying to run the script build_industrial_distribution_key.py I get the error below.
The cause seems to be that the column "index_right" does not exist in gdf.
gdf.rename(columns={"index_right": "bus"}, inplace=True) gdf["country"] = gdf.bus.str[:2]
Maybe the format of the hotmaps file changed?
=> Replace the line with
gdf["country"] = gdf["Country"] ?
gdf["country"] = gdf["Country"]
Or just use existing column "Country"?
(pypsa-eur) projekt-resilient03@ubuntu-22-04-lts-temp:~/pypsa-eur$ python scripts/build_industrial_distribution_key.py ERROR:root:Uncaught exception Traceback (most recent call last): File "/home/projekt-resilient03/pypsa-eur/scripts/build_industrial_distribution_key.py", line 189, in <module> hotmaps = prepare_hotmaps_database(regions) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/projekt-resilient03/pypsa-eur/scripts/build_industrial_distribution_key.py", line 120, in prepare_hotmaps_database gdf["country"] = gdf.bus.str[:2] ^^^^^^^ File "/home/projekt-resilient03/conda/envs/pypsa-eur/lib/python3.11/site-packages/pandas/core/generic.py", line 6299, in __getattr__ return object.__getattribute__(self, name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'GeoDataFrame' object has no attribute 'bus'
Related:
https://github.com/PyPSA/pypsa-eur/issues/1118
https://github.com/PyPSA/pypsa-eur/issues/1123
Similar issue in build_gas_input_locations.py:
build_gas_input_locations.py
gas_input_nodes.rename(columns={"index_right": "bus"}, inplace=True)
Describe the Bug
When trying to run the script build_industrial_distribution_key.py I get the error below.
The cause seems to be that the column "index_right" does not exist in gdf.
Maybe the format of the hotmaps file changed?
=> Replace the line with
gdf["country"] = gdf["Country"]
?Or just use existing column "Country"?
Error Message
Related:
https://github.com/PyPSA/pypsa-eur/issues/1118
https://github.com/PyPSA/pypsa-eur/issues/1123