Skip to content

Commit

Permalink
Fix a used column name in a buses df
Browse files Browse the repository at this point in the history
  • Loading branch information
ekatef committed May 3, 2023
1 parent bf3cbea commit b01438c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/simplify_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,11 @@ def merge_isolated_nodes(n, threshold, aggregation_strategies=dict()):

# all the nodes to be merged should be mapped into a single node
map_isolated_node_by_country = (
n.buses.loc[i_suffic_load].groupby("country")["bus_id"].first().to_dict()
n.buses.assign(bus_index=n.buses.index.get_level_values(0))
.loc[i_suffic_load]
.groupby("country")["bus_index"]
.first()
.to_dict()
)
isolated_buses_mapping = n.buses.loc[i_suffic_load, "country"].replace(
map_isolated_node_by_country
Expand Down

0 comments on commit b01438c

Please sign in to comment.