[Scipy-svn] r3573 - trunk/scipy/sandbox/timeseries

scipy-svn@scip... scipy-svn@scip...
Fri Nov 23 18:15:40 CST 2007


Author: pierregm
Date: 2007-11-23 18:15:38 -0600 (Fri, 23 Nov 2007)
New Revision: 3573

Modified:
   trunk/scipy/sandbox/timeseries/dates.py
Log:
dates   : improved .tolist()
plotlib : fixed a wrong format

Modified: trunk/scipy/sandbox/timeseries/dates.py
===================================================================
--- trunk/scipy/sandbox/timeseries/dates.py	2007-11-24 00:01:30 UTC (rev 3572)
+++ trunk/scipy/sandbox/timeseries/dates.py	2007-11-24 00:15:38 UTC (rev 3573)
@@ -373,8 +373,9 @@
     def tolist(self):
         """Returns a hierarchical python list of standard datetime objects."""
         _result = numpy.empty(self.shape, dtype=numpy.object_)
-        for idx, val in numpy.ndenumerate(self):
-            operator.setitem(_result, idx, Date(freq=self.freq, value=val).datetime)
+        _result.flat = [d.datetime for d in self.ravel()]
+#        for idx, val in numpy.ndenumerate(self):
+#            operator.setitem(_result, idx, Date(freq=self.freq, value=val).datetime)
         return _result.tolist()
     #
     def tostring(self):



More information about the Scipy-svn mailing list