[SciPy-user] TimeSeries concatenate

Robert Ferrell ferrell@diablotech....
Fri May 22 08:09:03 CDT 2009


This was user error, of course.  I needed an extra set of parens:

ts.concatenate( (ts1, ts2) )

Question: What happens to duplicate dates?  It seems that the data in  
the first series is used.  Is that the rule?

thanks,
-robert

On May 22, 2009, at 7:02 AM, Robert Ferrell wrote:

> I'm having trouble with concatenate in scikits.timeseries.  I can't
> find (timeseries) concatenate documented, but I did find an example
> from a few years ago (http://projects.scipy.org/scipy/changeset/3570),
> so maybe this isn't supported.
>
> Here's what I get when I try to use the timeseries concatenate.
>
> In [82]: import scikits.timeseries as ts
>
> In [83]: ts1 = ts.time_series(data=[1,2,3], start_date=ts.now('d'))
>
> In [84]: ts2 = ts.time_series(data=[4,5,6], start_date=ts.now('d')+1)
>
> In [85]: ts.concatenate(ts1, ts2)
> ---------------------------------------------------------------------------
> <type 'exceptions.AttributeError'>        Traceback (most recent call
> last)
>
> /Users/Shared/Develop/Financial/LakMerc/Mercury/tests/<ipython
> console> in <module>()
>
> /Library/Frameworks/Python.framework/Versions/2.5.2001/lib/python2.5/
> site-packages/scikits/timeseries/tseries.py in concatenate(series,
> axis, remove_duplicates, fill_missing)
>    1950     """
>    1951     # Get the common frequency, raise an error if
> incompatibility
> -> 1952     common_f = _compare_frequencies(*series)
>    1953     # Concatenate the order of series
>    1954     sidx = np.concatenate([np.repeat(i,len(s))
>
> /Library/Frameworks/Python.framework/Versions/2.5.2001/lib/python2.5/
> site-packages/scikits/timeseries/tseries.py in
> _compare_frequencies(*series)
>     284 frequencies.
>     285 """
> --> 286     unique_freqs = np.unique([x.freqstr for x in series])
>     287     try:
>     288         common_freq = unique_freqs.item()
>
> <type 'exceptions.AttributeError'>: 'numpy.int32' object has no
> attribute 'freqstr'
>
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-user@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user



More information about the SciPy-user mailing list