Skip to content
This repository was archived by the owner on Dec 10, 2019. It is now read-only.

Commit cd6df95

Browse files
author
David Bailey
committed
swtiched back to amtrak from metro-la
1 parent 04639fa commit cd6df95

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

speeds.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,20 @@ def __getitem__(self, name):
4141
return getattr(self, name)
4242

4343
# amtrak = gtfstk.feed.Feed(expanduser('~/Desktop/la-metro_20101211_0848.zip')) #http://www.gtfs-data-exchange.com/agency/la-metro/
44-
# amtrak = getFeed('http://gtfs.s3.amazonaws.com/amtrak_20140723_0354.zip')
45-
amtrak = getFeed('http://gtfs.s3.amazonaws.com/la-metro_20101211_0848.zip')
46-
amtrak.trips.set_index('route_id', inplace=True)
47-
amtrak.trips.sort_index(inplace=True)
48-
amtrak.stop_times.set_index('stop_headsign', inplace=True)
49-
amtrak.stop_times.sort_index(inplace=True)
44+
amtrak = getFeed('http://gtfs.s3.amazonaws.com/amtrak_20140723_0354.zip')
5045
amtrak.stops.set_index('stop_id', inplace=True)
5146
amtrak.stops.sort_index(inplace=True)
47+
#amtrak = getFeed('http://gtfs.s3.amazonaws.com/la-metro_20101211_0848.zip')
48+
#amtrak.stop_times.set_index('stop_headsign', inplace=True)
49+
#amtrak.stop_times.sort_index(inplace=True)
50+
#amtrak.trips.set_index('route_id', inplace=True)
51+
#amtrak.trips.sort_index(inplace=True)
5252

5353
def getJSONs(route,direction):
54-
# trip_ids = amtrak.trips[(amtrak.trips['route_id'].astype(str) == str(route).replace('%20', ' ')) & (amtrak.trips['direction_id'] == int(direction))]['trip_id']
55-
# stops = pandas.merge(pandas.DataFrame(trip_ids),amtrak.stop_times)
56-
trip_ids = amtrak.trips.loc[str(route).replace('%20', ' ')]['trip_id']
57-
stops = pandas.merge(pandas.DataFrame(trip_ids),amtrak.stop_times.loc[str(direction).replace('%20',' ')])
54+
trip_ids = amtrak.trips[(amtrak.trips['route_id'].astype(str) == str(route).replace('%20', ' ')) & (amtrak.trips['direction_id'] == int(direction))]['trip_id']
55+
stops = pandas.merge(pandas.DataFrame(trip_ids),amtrak.stop_times)
56+
# trip_ids = amtrak.trips.loc[str(route).replace('%20', ' ')]['trip_id']
57+
# stops = pandas.merge(pandas.DataFrame(trip_ids),amtrak.stop_times.loc[str(direction).replace('%20',' ')])
5858
trains = stops.groupby('trip_id')
5959
stop_ids = []
6060
for index, train in trains:

0 commit comments

Comments
 (0)