Skip to content

Commit

Permalink
Fix join columns. (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
Clint Daniels authored and e-lo committed Jul 2, 2018
1 parent 7a63e10 commit 2301556
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions fasttrips/Assignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2301556

Please sign in to comment.