[SciPy-User] Sum duplicate dates in a series

Keith Goodman kwgoodman@gmail....
Fri Jan 29 14:09:42 CST 2010


On Fri, Jan 29, 2010 at 11:36 AM,  <josef.pktd@gmail.com> wrote:
> I just wanted to show that there will be some advantages when it is
> possible to easily move between packages
>
>>>> import scikits.timeseries as ts
>>>> import la
>>>> s = ts.time_series([1,2,3,4,5],dates=ts.date_array(["2001-01","2001-01","2001-02","2001-03","2001-03"],freq="M"))
>>>> dta = la.larry(s.data, label=[range(len(s.data))])
>>>> dat = la.larry(s.dates.tolist(), label=[range(len(s.data))])

Clever use of larry. The default label is range(n) so you can just do

>>>> dta = la.larry(s.data)
>>>> dat = la.larry(s.dates.tolist())


More information about the SciPy-User mailing list