File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -452,15 +452,11 @@ def add_mid_block_deadhead(self) -> Self:
452452 )
453453
454454 deadhead_trip_times ["trip_duration_minutes" ] = (
455- (
456- (
457- deadhead_trip_times ["end_time" ] - deadhead_trip_times ["start_time" ]
458- ).dt .total_seconds ()
459- / 60
460- )
461- .round ()
462- .astype (int )
463- )
455+ pd .to_timedelta (
456+ deadhead_trip_times ["end_time" ] - deadhead_trip_times ["start_time" ]
457+ ).dt .total_seconds ()
458+ / 60
459+ ).round (2 )
464460
465461 # Convert start/end times to GTFS-style strings
466462 def format_timedelta (td : pd .Timedelta ) -> str :
@@ -602,15 +598,11 @@ def add_depot_deadhead(self) -> Self:
602598 )
603599
604600 deadhead_trip_times ["trip_duration_minutes" ] = (
605- (
606- (
607- deadhead_trip_times ["end_time" ] - deadhead_trip_times ["start_time" ]
608- ).dt .total_seconds ()
609- / 60
610- )
611- .round ()
612- .astype (int )
613- )
601+ pd .to_timedelta (
602+ deadhead_trip_times ["end_time" ] - deadhead_trip_times ["start_time" ]
603+ ).dt .total_seconds ()
604+ / 60
605+ ).round (2 )
614606
615607 # Convert start/end times to GTFS-style strings
616608 def format_timedelta (td : pd .Timedelta ) -> str :
You can’t perform that action at this time.
0 commit comments