Author stutzbach
Recipients agthorr, belopolsky, christian.heimes, gregory.p.smith, pitrou, ronaldoussoren, steven.daprano, stutzbach, tshepang, vajrasky
Date 2013-08-04.20:14:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1375647270.14.0.24258950211.issue18606@psf.upfronthosting.co.za>
In-reply-to
Content
As the person originally trying to take the mean of timedelta objects, I'm personally fine with the workaround of:

py> m = statistics.mean([x.total_seconds() for x in data])
py> td(seconds=m)
datetime.timedelta(2, 43200)

At the time I was trying to take the mean of timedelta objects, even the total_seconds() method did not exist in the version of Python I was using.

On the flip side, wouldn't sum() work on timedelta objects if you simply removed the "isinstance(start, numbers.Number)" check?
History
Date User Action Args
2013-08-04 20:14:30stutzbachsetrecipients: + stutzbach, gregory.p.smith, ronaldoussoren, belopolsky, pitrou, agthorr, christian.heimes, steven.daprano, tshepang, vajrasky
2013-08-04 20:14:30stutzbachsetmessageid: <1375647270.14.0.24258950211.issue18606@psf.upfronthosting.co.za>
2013-08-04 20:14:30stutzbachlinkissue18606 messages
2013-08-04 20:14:29stutzbachcreate