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

scipy-svn@scip... scipy-svn@scip...
Wed Mar 7 10:58:17 CST 2007


Author: mattknox_ca
Date: 2007-03-07 10:58:14 -0600 (Wed, 07 Mar 2007)
New Revision: 2836

Modified:
   trunk/Lib/sandbox/timeseries/tcore.py
Log:
added get_freq_group

Modified: trunk/Lib/sandbox/timeseries/tcore.py
===================================================================
--- trunk/Lib/sandbox/timeseries/tcore.py	2007-03-07 16:57:56 UTC (rev 2835)
+++ trunk/Lib/sandbox/timeseries/tcore.py	2007-03-07 16:58:14 UTC (rev 2836)
@@ -126,16 +126,14 @@
         result += [pr+'-'+mth_str for mth_str in (month[:3], month)]
     return result
 
-
-
-freq_dict = { FR_QTR: ['Q','QUARTER','QUARTERLY',],
-              FR_MTH: ['M','MONTH','MONTHLY',],
+freq_dict = { FR_QTR: ['Q','QUARTER','QUARTERLY'],
+              FR_MTH: ['M','MONTH','MONTHLY'],
               FR_BUS: ['B','BUSINESS','BUSINESSLY'],
-              FR_DAY: ['D','DAY','DAILY',],
-              FR_HR: ['H','HOUR','HOURLY',],
-              FR_MIN: ['T','MINUTE','MINUTELY',],
-              FR_SEC: ['S','SECOND','SECONDLY',],
-              FR_UND: ['U','UNDEF','UNDEFINED'],
+              FR_DAY: ['D','DAY','DAILY'],
+              FR_HR: ['H','HOUR','HOURLY'],
+              FR_MIN: ['T','MINUTE','MINUTELY'],
+              FR_SEC: ['S','SECOND','SECONDLY'],
+              FR_UND: ['U','UNDEF','UNDEFINED']
                 }
                 
 for _freq, day_str in _week_end_map.iteritems():
@@ -186,6 +184,10 @@
     else:
         raise ValueError("Invalid frequency: %s " % str(freq))    
 fmtFreq = check_freqstr
+
+def get_freq_group(freq):
+    # truncate frequency to nearest thousand
+    return (freq//1000)*1000
         
 
 #####---------------------------------------------------------------------------



More information about the Scipy-svn mailing list