From 83ab4380350cbb88d9bf662267f9fb879c3210ac Mon Sep 17 00:00:00 2001 From: David Bailey Date: Mon, 28 Sep 2015 10:16:51 -0700 Subject: [PATCH] allow routes to have spaces in them --- speeds.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/speeds.py b/speeds.py index 82c2975..0f9da62 100644 --- a/speeds.py +++ b/speeds.py @@ -27,7 +27,7 @@ def combine(listA,listB): def getJSONs(route,direction): amtrak = gtfstk.feed.Feed(expanduser('~/Desktop/amtrak_20140723_0354.zip')) #http://www.gtfs-data-exchange.com/agency/amtrak/ - trip_ids = amtrak.trips[(amtrak.trips['route_id'] == str(route)) & (amtrak.trips['direction_id'] == int(direction))]['trip_id'] + trip_ids = amtrak.trips[(amtrak.trips['route_id'] == str(route).replace('%20', ' ') & (amtrak.trips['direction_id'] == int(direction))]['trip_id'] stops = pandas.merge(pandas.DataFrame(trip_ids),amtrak.stop_times) trains = stops.groupby('trip_id') stop_ids = []