[SciPy-User] Question about scikits.timeseries.lib.moving_funcs.mov_average

Andreas lists@hilboll...
Wed Jun 23 10:59:24 CDT 2010


Hi, thanks for your input!

> In [4]: arr
> Out[4]:
> array([  0.,   1.,   2.,   3.,   4.,   5.,   6.,   7.,   8.,   9.,  NaN,
>         NaN,  NaN,  NaN,  NaN,  15.,  16.,  17.,  18.,  19.])
>
> In [5]: rolling_mean(arr, 10, min_periods=1)
> Out[5]:
> array([  0. ,   0.5,   1. ,   1.5,   2. ,   2.5,   3. ,   3.5,   4. ,
>          4.5,   5. ,   5.5,   6. ,   6.5,   7. ,   9. ,  11. ,  13. ,
>         15. ,  17. ])

Actually, this is exactly what I'm looking for. Well, almost. For my
application, I would need the window to be centered on the current value,
and be going only backwards from it. (I'm analyzing atmospheric
measurement data.)

Any ideas how this can be done?

Cheers,

Andreas.



More information about the SciPy-User mailing list