Merge pull request #861 from PyPSA/fix_clustering
fix clustering bug due to missing countries in n.buses
This commit is contained in:
commit
85ecb1355a
@ -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 == "na"
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user