[Scipy-svn] r2615 - trunk/Lib/sandbox/timeseries

scipy-svn at scipy.org scipy-svn at scipy.org
Fri Jan 26 15:20:14 CST 2007


Author: mattknox_ca
Date: 2007-01-26 15:20:10 -0600 (Fri, 26 Jan 2007)
New Revision: 2615

Modified:
   trunk/Lib/sandbox/timeseries/tseries.py
Log:
fixed bug with start_date and end_date properties where it crashed if series.size == 0

Modified: trunk/Lib/sandbox/timeseries/tseries.py
===================================================================
--- trunk/Lib/sandbox/timeseries/tseries.py	2007-01-26 01:17:04 UTC (rev 2614)
+++ trunk/Lib/sandbox/timeseries/tseries.py	2007-01-26 21:20:10 UTC (rev 2615)
@@ -473,12 +473,18 @@
     @property
     def start_date(self):
         """Returns the first date of the series."""
-        return self._dates[0]
+        if self._dates.size != 0:
+            return self._dates[0]
+        else:
+            return None
 
     @property
     def end_date(self):
         """Returns the last date of the series."""
-        return self._dates[-1]
+        if self._dates.size != 0:
+            return self._dates[-1]
+        else:
+            return None
 
     
     def isvalid(self):



More information about the Scipy-svn mailing list