[SciPy-user] removing certain dates from a time series

Pierre GM pgmdevlist@gmail....
Tue Apr 1 16:51:17 CDT 2008


Marco,

> How to I remove the february 29 from my timeseries without affecting the
> dates after?

Don't remove the dates, just mask the corresponding data, as illustrated in 
the following

>>>import numpy
>>>from numpy.ma import masked
>>>import scikits.timeseries as ts
>>>series=ts.time_series(numpy.arange(3650),start_date=ts.now('D'))
>>>series[(series.days==29)&(series.months==2)]=ma.masked

As long as your analysis functions deal w/ masked values in a nice way, you're 
set (for example, mean/sum/var all work well with masked values).
HIH
P.


More information about the SciPy-user mailing list