[SciPy-User] Align empty time series

Robert Ferrell ferrell@diablotech....
Fri Jan 29 11:58:13 CST 2010


ts.align_series fails if both series are empty.  As a feature request,  
could this special case be handled and return an empty series?  As it  
is I have to special case this in my code, which adds some clutter.

thanks,
-robert


> In [1566]: e1 = ts.time_series(freq='d', data=[], dates=[])
>
> In [1567]: e2 = ts.time_series(freq='d', data=[], dates=[])
>
> In [1568]: ts.align_series(e1,e2)
> ---------------------------------------------------------------------------
> ValueError                                Traceback (most recent  
> call last)
>
> /Users/Shared/Develop/Financial/LakMerc/Reports/maFiltersTest.py in  
> <module>()
> ----> 1
>       2
>       3
>       4
>       5
>
> /Library/Python/2.6/site-packages/scikits.timeseries-0.91.3-py2.6- 
> macosx-10.6-universal.egg/scikits/timeseries/tseries.pyc in  
> align_series(*series, **kwargs)
>    1841     start_date = kwargs.pop('start_date',
>    1842                             min([x.start_date for x in  
> filled_series
> -> 1843                                      if x.start_date is not  
> None]))
>    1844     if isinstance(start_date, str):
>    1845         start_date = Date(common_freq, string=start_date)
>
> ValueError: min() arg is an empty sequence
> > /Library/Python/2.6/site-packages/scikits.timeseries-0.91.3-py2.6- 
> macosx-10.6-universal.egg/scikits/timeseries/ 
> tseries.py(1843)align_series()
>    1842                             min([x.start_date for x in  
> filled_series
> -> 1843                                      if x.start_date is not  
> None]))
>    1844     if isinstance(start_date, str):
>




More information about the SciPy-User mailing list