Skip to content

Tag: timedelta

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? 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…

How can I make a python numpy arange of datetime

I have some input data, with timestamps in the input file in the form of hours from the date time specified in the filename. This is a bit useless, so I need to convert it to python datetime.datetime objects, and then put it in a numpy array. I could write a for loop, but I’d like to do something like: