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

scipy-svn at scipy.org scipy-svn at scipy.org
Tue Jan 30 14:08:49 EST 2007


Author: mattknox_ca
Date: 2007-01-30 13:08:46 -0600 (Tue, 30 Jan 2007)
New Revision: 2643

Modified:
   trunk/Lib/sandbox/timeseries/tseries.py
Log:
modified convert function to pass integer frequencies to c code

Modified: trunk/Lib/sandbox/timeseries/tseries.py
===================================================================
--- trunk/Lib/sandbox/timeseries/tseries.py	2007-01-30 18:40:43 UTC (rev 2642)
+++ trunk/Lib/sandbox/timeseries/tseries.py	2007-01-30 19:08:46 UTC (rev 2643)
@@ -523,6 +523,14 @@
     containing the indices of the non-zero elements in that dimension."""
         return self._series.nonzero()
         
+def _attrib_dict(series, exclude=[]):
+    """this function is used for passing through attributes of one
+time series to a new one being created"""
+    result = {'fill_value':series.fill_value,
+              'observed':series.observed}
+    return dict(filter(lambda x: x[0] not in exclude, result.iteritems()))
+    
+        
 ##### --------------------------------------------------------------------------
 ##--- ... Additional methods ...
 ##### --------------------------------------------------------------------------
@@ -1117,7 +1125,7 @@
     if position.upper() not in ('END','START'): 
         raise ValueError("invalid value for position argument: (%s)",str(position))
     
-    toFreq = corelib.fmtFreq(freq)
+    toFreq = corelib.check_freq(freq)
     fromFreq = series.freq
     start_date = series._dates[0]
     
@@ -1180,7 +1188,7 @@
            freq  = A)
 """
     #Backup series attributes
-    options = dict(fill_value=series.fill_value, observed=series.observed)
+    options = _attrib_dict(series)
     newdata = masked_array(numeric.empty(series.shape, dtype=series.dtype), 
                            mask=True)
     if copy:




More information about the Scipy-svn mailing list