Merge pull request #971 from koen-vg/fix-sanitize-locations
Only sanitize locations when there are buses with a location
This commit is contained in:
commit
db4219f4d5
@ -184,12 +184,13 @@ def sanitize_carriers(n, config):
|
|||||||
|
|
||||||
|
|
||||||
def sanitize_locations(n):
|
def sanitize_locations(n):
|
||||||
n.buses["x"] = n.buses.x.where(n.buses.x != 0, n.buses.location.map(n.buses.x))
|
if "location" in n.buses.columns:
|
||||||
n.buses["y"] = n.buses.y.where(n.buses.y != 0, n.buses.location.map(n.buses.y))
|
n.buses["x"] = n.buses.x.where(n.buses.x != 0, n.buses.location.map(n.buses.x))
|
||||||
n.buses["country"] = n.buses.country.where(
|
n.buses["y"] = n.buses.y.where(n.buses.y != 0, n.buses.location.map(n.buses.y))
|
||||||
n.buses.country.ne("") & n.buses.country.notnull(),
|
n.buses["country"] = n.buses.country.where(
|
||||||
n.buses.location.map(n.buses.country),
|
n.buses.country.ne("") & n.buses.country.notnull(),
|
||||||
)
|
n.buses.location.map(n.buses.country),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def add_co2_emissions(n, costs, carriers):
|
def add_co2_emissions(n, costs, carriers):
|
||||||
|
Loading…
Reference in New Issue
Block a user