[SciPy-user] scikits.timeseries : Calculate previous 30 day and30-60 day cumulative flows.

Dharhas Pothina Dharhas.Pothina@twdb.state.tx...
Tue Jul 14 13:18:35 CDT 2009


>>> Pierre GM <pgmdevlist@gmail.com> 07/14/09 12:48 PM >>>
> Now that's a strange one. Send me more info (inflows_ts, version, ...)

I was able to recreate the error with a shorter dataset. I'm using np.__version__ = '1.3.0'
and ts.__version__ =  '0.91.1'

In [24]: inflows_ts
Out[24]: 
timeseries([(798062.75047999993,) (634009.66576,) (753657.40423999995,)
 (783260.9683999999,) (653745.37520000001,) (572335.57375999994,)
 (582203.42848,) (567401.64639999997,) (542732.00959999999,)
 (616740.91999999993,)],
   dtype = [('Inflow', '<f8')],
   dates = [01-Jan-1977 ... 10-Jan-1977],
   freq  = D)

In [25]: mov_sum(inflows_ts,2)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)

/T/SWR/BaysEstuaries/PROJECTS/SAN_BERNARD/SB_FWI_2007/SB_WETLAND_STUDY/SB_FieldData/SB_Final/regress_sbdata.py in <module>()
----> 1 
      2 
      3 
      4 
      5 

/usr/lib64/python2.5/site-packages/scikits.timeseries-0.91.1-py2.5-linux-x86_64.egg/scikits/timeseries/lib/moving_funcs.pyc in mov_sum(data, span, dtype)
    169     """
    170 
--> 171     return _mov_sum(data, span, dtype=dtype)
    172 #...............................................................................
    173 def mov_median(data, span, dtype=None):

/usr/lib64/python2.5/site-packages/scikits.timeseries-0.91.1-py2.5-linux-x86_64.egg/scikits/timeseries/lib/moving_funcs.pyc in _mov_sum(data, span, dtype, type_num_double)
    154     if dtype is not None:
    155         kwargs['dtype'] = dtype
--> 156     return _moving_func(data, MA_mov_sum, kwargs)
    157 #...............................................................................
    158 def mov_sum(data, span, dtype=None):

/usr/lib64/python2.5/site-packages/scikits.timeseries-0.91.1-py2.5-linux-x86_64.egg/scikits/timeseries/lib/moving_funcs.pyc in _moving_func(data, cfunc, kwargs)
    119 def _moving_func(data, cfunc, kwargs):
    120 
--> 121     data = ma.fix_invalid(data)
    122     data = ma.array(data.filled(0), mask=data._mask)
    123 

/usr/lib/python2.5/site-packages/numpy-1.3.0-py2.5-linux-x86_64.egg/numpy/ma/core.pyc in fix_invalid(a, mask, copy, fill_value)
    514     a = masked_array(a, copy=copy, mask=mask, subok=True)
    515     #invalid = (numpy.isnan(a._data) | numpy.isinf(a._data))
--> 516     invalid = np.logical_not(np.isfinite(a._data))
    517     if not invalid.any():
    518         return a

AttributeError: logical_not


More information about the SciPy-user mailing list