Message194418
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? |
|
Date |
User |
Action |
Args |
2013-08-04 20:14:30 | stutzbach | set | recipients:
+ stutzbach, gregory.p.smith, ronaldoussoren, belopolsky, pitrou, agthorr, christian.heimes, steven.daprano, tshepang, vajrasky |
2013-08-04 20:14:30 | stutzbach | set | messageid: <1375647270.14.0.24258950211.issue18606@psf.upfronthosting.co.za> |
2013-08-04 20:14:30 | stutzbach | link | issue18606 messages |
2013-08-04 20:14:29 | stutzbach | create | |
|