[x] I am using the current main branch or the latest release. Please indicate.
[x] I am running on an up-to-date pypsa-africa environment. Update via conda env update -f envs/environment.yaml.
Describe the Bug
I receive in the following code the IdexError
geodf_temp["GADM_ID"] = geodftemp[f"GID{cur_layer_id}"].apply(
lambda x: x if x[3] == "." else x[:3] + "." + x[3:]
)
geodf_temp is the following dataframe:
GID_0 COUNTRY geometry
0 BI Burundi MULTIPOLYGON (((30.04515 -4.25684, 30.04523 -4...
--> GID_0 has no third char --> string index out of range
Error Message
Ausnahme: IndexError
string index out of range
File "/mnt/l/Git/Africa/pypsa-earth-sec/scripts/prepare_gas_network.py", line 465, in <lambda>
lambda x: x if x[3] == "." else x[:3] + "." + x[3:]
File "/mnt/l/Git/Africa/pypsa-earth-sec/scripts/prepare_gas_network.py", line 464, in get_GADM_layer
geodf_temp["GADM_ID"] = geodf_temp[f"GID_{cur_layer_id}"].apply(
File "/mnt/l/Git/Africa/pypsa-earth-sec/scripts/prepare_gas_network.py", line 491, in gadm
df_gadm = get_GADM_layer(countries, layer_id, geo_crs, contended_flag, update)
File "/mnt/l/Git/Africa/pypsa-earth-sec/scripts/prepare_gas_network.py", line 551, in load_bus_region
bus_regions_onshore = gadm(
File "/mnt/l/Git/Africa/pypsa-earth-sec/scripts/prepare_gas_network.py", line 903, in <module>
bus_regions_onshore = load_bus_region(snakemake.input.regions_onshore, pipelines)[0]
IndexError: string index out of range```
Checklist
main
branch or the latest release. Please indicate.pypsa-africa
environment. Update viaconda env update -f envs/environment.yaml
.Describe the Bug
I receive in the following code the IdexError geodf_temp["GADM_ID"] = geodftemp[f"GID{cur_layer_id}"].apply( lambda x: x if x[3] == "." else x[:3] + "." + x[3:] )
geodf_temp is the following dataframe: GID_0 COUNTRY geometry 0 BI Burundi MULTIPOLYGON (((30.04515 -4.25684, 30.04523 -4...
--> GID_0 has no third char --> string index out of range
Error Message