Skip to content
Advertisement

Convert result of sum of timedeltas in Python

I have the output below from a sum of a timedelta list in a column on my dataframe. How do I get values converted to hours minutes and total seconds?

JavaScript

Advertisement

Answer

afaik, there’s no built-in functionality for this. But you can create your own. For example for formatting to a string in H:M:S format or splitting the timedelta into separate columns hours, minutes and seconds. Ex:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement