[SciPy-user] timeseries and maskedarrays

bevan bevan07 at gmail.com
Mon Mar 17 17:29:59 EDT 2008


>>snip<< 

Thanks for the replies - Arthur, I will check out the CDAT package in more 
depth in the future but at this stage I am keen to get my head around the 
timeseries package.

Matt, Thanks heaps, your post has really helped me to get timeseries going.  Of 
course this meant a rewrite to use my new understanding.  I have created the 
maskedarrays as you suggested (i think) but i run into an issue when I create 
monthly summaries with timeseries data that has a masked array.  I have put 
some sample code below.  The issue is the results of the ma.sum when converting 
masked daily data to monthly.  The masked values are being expressed as numbers 
rather than the mask symbol I would expect.  Is this related to the versions I 
am using?

import numpy as np
from numpy import ma
import timeseries as ts

# create a simple test series at daily frequency
testmask = 
[False,False,True,False,False,False,False,False,False,False,False,False,False,Tr
ue,False,False,False,False,False,False]
series = ts.time_series(np.random.normal(size=20), start_date=ts.now
('d'),mask=testmask)
monthly_sums = series.convert('monthly', ma.sum)
monthly = series.convert('monthly')
print monthly_sums
#print monthly
>>> 
[  2.00000000e+20  -7.82157628e-01]









More information about the SciPy-User mailing list