diff --git a/backend/app/get_travel_time.py b/backend/app/get_travel_time.py index fe132b8..0426afc 100644 --- a/backend/app/get_travel_time.py +++ b/backend/app/get_travel_time.py @@ -97,7 +97,9 @@ def get_travel_time(start_node, end_node, start_time, end_time, start_date, end_ # filter out hours with too much missing data observations = hr_sums[ hr_sums['length'] / total_corridor_length >= 0.8 ] # extrapolate over missing data within each hour - observations['tt_extrapolated'] = observations['tt'] * total_corridor_length / observations['length'] + observations = observations.assign( + tt_extrapolated = lambda r: r.tt * total_corridor_length / r.length + ) # convert to format that can be used by the same summary function sample = [] for tup in observations.itertuples():