[SciPy-User] Sum duplicate dates in a series

Robert Ferrell ferrell@diablotech....
Fri Jan 29 12:16:16 CST 2010


How can I sum data for duplicate dates in a time series?  I can do it  
with a loop, but I wonder if there is some tricky magic I might use.

For instance, I've got a series:

> In [1597]: s
> Out[1597]:
> timeseries([ 10.  11.   1.   2.   3.],
>    dates = [12-Jan-2010 12-Jan-2010 22-Jan-2010 22-Jan-2010 22- 
> Jan-2010],
>    freq  = D)
>

and I'd like to sum the Jan 12 data together, and the Jan 22 data  
together, and return a new series with just two dates.

> timeseries([ 21.   6.],
>    dates = [12-Jan-2010 22-Jan-2010],
>    freq  = D)
>

Is there an easy way?

Thanks,
-robert


More information about the SciPy-User mailing list