[Scipy-svn] r2487 - trunk/Lib/sandbox/timeseries
scipy-svn at scipy.org
scipy-svn at scipy.org
Thu Jan 4 11:09:56 EST 2007
Author: mattknox_ca
Date: 2007-01-04 10:09:52 -0600 (Thu, 04 Jan 2007)
New Revision: 2487
Modified:
trunk/Lib/sandbox/timeseries/timeseries.py
Log:
modified convert method to use updated c code
Modified: trunk/Lib/sandbox/timeseries/timeseries.py
===================================================================
--- trunk/Lib/sandbox/timeseries/timeseries.py 2007-01-04 16:08:13 UTC (rev 2486)
+++ trunk/Lib/sandbox/timeseries/timeseries.py 2007-01-04 16:09:52 UTC (rev 2487)
@@ -190,7 +190,6 @@
if self.size == 0:
return TimeSeries(self, freq=toFreq, start_date=tsdate.dateOf(self.start_date(), toFreq))
-
tempData = self.filled()
if self.mask is ma.nomask:
@@ -198,7 +197,7 @@
tempMask[:] = False
else: tempMask = self.mask
- cRetVal = cseries.reindex(tempData, fromFreq, toFreq, position, int(self.start_date()), tempMask)
+ cRetVal = cseries.convert(tempData, fromFreq, toFreq, position, int(self.start_date()), tempMask)
_values = cRetVal['values']
_mask = cRetVal['mask']
@@ -210,11 +209,12 @@
if func is not None and tempData.ndim == 2:
tempData = corelib.apply_along_axis(func, 1, tempData)
- startIndex = cseries.convert(int(self.start_date()), fromFreq, toFreq)
-
- newStart = tsdate.dateOf(self.start_date(),toFreq, "BEFORE")
- newEnd = tsdate.dateOf(self.end_date(),toFreq, "AFTER")
+ startIndex = cseries.asfreq(numpy.asarray(int(self.start_date())), fromFreq, toFreq, 'BEFORE')
+ newStart = tsdate.Date(freq=toFreq, value=startIndex)
+ endIndex = cseries.asfreq(numpy.asarray(int(self.end_date())), fromFreq, toFreq, 'AFTER')
+ newEnd = tsdate.Date(freq=toFreq, value=endIndex)
+
return adjust_endpoints(TimeSeries(tempData, freq=toFreq, observed=self.observed, start_date=startIndex), start_date=newStart, end_date=newEnd)
else:
More information about the Scipy-svn
mailing list