From 23015560a2bfe22a9de2f970d3056fc2147215fd Mon Sep 17 00:00:00 2001 From: Clint Daniels Date: Fri, 9 Mar 2018 10:29:05 -0800 Subject: [PATCH] Fix join columns. (#132) --- fasttrips/Assignment.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fasttrips/Assignment.py b/fasttrips/Assignment.py index c71e8191..99133886 100644 --- a/fasttrips/Assignment.py +++ b/fasttrips/Assignment.py @@ -1268,7 +1268,7 @@ def find_passenger_vehicle_times(pathset_links_df, veh_trips_df): #This is a little long winded, but it cuts down on memory dramatically, but only copying #what is actually needed during the merges. - intermediate = pd.merge(left=pathset_links_df[[Trip.STOPTIMES_COLUMN_TRIP_ID,'A_id','A_seq', + intermediate = pd.merge(left=pathset_links_df[[Passenger.PERSONS_COLUMN_PERSON_ID, Trip.STOPTIMES_COLUMN_TRIP_ID,'A_id','A_seq', Passenger.TRIP_LIST_COLUMN_PERSON_TRIP_ID, Passenger.PF_COL_PATH_NUM, Passenger.PF_COL_LINK_NUM, @@ -1309,7 +1309,10 @@ def find_passenger_vehicle_times(pathset_links_df, veh_trips_df): FastTripsLogger.debug("find_passenger_vehicle_times(): output pathset_links_df len=%d\n%s" % \ (len(pathset_links_df), pathset_links_df.loc[pathset_links_df[Passenger.TRIP_LIST_COLUMN_TRACE]==True].to_string())) - return pd.merge(pathset_links_df, intermediate, on=['person_trip_id', 'pathnum', 'linknum'], how='left') + return pd.merge(pathset_links_df, intermediate, on=[Passenger.PERSONS_COLUMN_PERSON_ID, + Passenger.TRIP_LIST_COLUMN_PERSON_TRIP_ID, + Passenger.PF_COL_PATH_NUM, + Passenger.PF_COL_LINK_NUM,], how='left') @staticmethod