Durations: Finish Times with Timedelta

Finish times typed as text such as '0:27:15' sort wrongly and can't be averaged, so pd.to_timedelta turns them into durations, the ones it can't read, such as '27:15', are found with errors='coerce' and fixed, dt.total_seconds() turns a duration into minutes and a pace per mile, and whole minutes and seconds turn it back into text people can read.

By

Updated

Cheat sheet: Durations: Finish Times with Timedelta
Category
Data Analysis
Level
Journeyman
Tags
python, Timedelta, to_timedelta(), total_seconds()