How to turn a series that contains pandas.datetime.timedelta to floats e.g. hours or days? I want to plot some data that contains timedeltas. However, the numpy plot() and errorbar() return:

TypeError: float() argument must be a string or a number, not 'Timedelta'


The question is how can I efficiently convert the timedeltas to a float or integer number. E.g. when I use minutes as base:

0 days 01:30:00 -&gt; 90


or hours

0 days 01:30:00 -&gt; 1.5


Similar to Series.dt.days which would return 0 in this case.
One way to do this would be to use Series.dt.seconds and ´Series.dt.days´ and  multiply with a factor for the desired unit:

(Series.dt.seconds/3600) + (Series.dt.days*24)  # for values with [hours]