[Scipy-svn] r2619 - trunk/Lib/sandbox/timeseries
scipy-svn at scipy.org
scipy-svn at scipy.org
Fri Jan 26 16:56:56 EST 2007
Author: mattknox_ca
Date: 2007-01-26 15:56:53 -0600 (Fri, 26 Jan 2007)
New Revision: 2619
Modified:
trunk/Lib/sandbox/timeseries/tseries.py
Log:
fixed more bugs with empty time series
Modified: trunk/Lib/sandbox/timeseries/tseries.py
===================================================================
--- trunk/Lib/sandbox/timeseries/tseries.py 2007-01-26 21:49:05 UTC (rev 2618)
+++ trunk/Lib/sandbox/timeseries/tseries.py 2007-01-26 21:56:53 UTC (rev 2619)
@@ -199,8 +199,11 @@
# Check dates ........
if dates is None:
length = _getdatalength(data)
- newdates = date_array(start_date=start_date, length=length,
- freq=freq)
+ if length > 0:
+ newdates = date_array(start_date=start_date, length=length,
+ freq=freq)
+ else:
+ newdates = date_array([], freq=freq)
elif not hasattr(dates, 'freq'):
newdates = date_array(dlist=dates, freq=freq)
else:
@@ -882,8 +885,12 @@
"""
if dates is None:
length = _getdatalength(data)
- dates = date_array(start_date=start_date, end_date=end_date,
- length=length, include_last=include_last, freq=freq)
+ if length > 0:
+ dates = date_array(start_date=start_date, end_date=end_date,
+ length=length, include_last=include_last, freq=freq)
+ else:
+ dates = date_array([], freq=freq)
+
elif not isinstance(dates, DateArray):
dates = date_array(dlist=dates, freq=freq)
return TimeSeries(data=data, dates=dates, mask=mask, observed=observed,
More information about the Scipy-svn
mailing list