Update scripts/base_network.py

Co-authored-by: Fabian Hofmann <fab.hof@gmx.de>
This commit is contained in:
Fabian Neumann 2024-01-18 18:22:21 +01:00 committed by GitHub
parent 7ebf3b186c
commit 498f3bffad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -560,7 +560,7 @@ def _set_countries_and_substations(n, config, country_shapes, offshore_shapes):
~buses["under_construction"] ~buses["under_construction"]
) )
c_nan_b = buses.country.isna() c_nan_b = buses.country.fillna("na") == "na"
if c_nan_b.sum() > 0: if c_nan_b.sum() > 0:
c_tag = _get_country(buses.loc[c_nan_b]) c_tag = _get_country(buses.loc[c_nan_b])
c_tag.loc[~c_tag.isin(countries)] = np.nan c_tag.loc[~c_tag.isin(countries)] = np.nan