[Numpy-discussion] Filling gaps
Thu Feb 12 19:33:26 CST 2009
On Feb 12, 2009, at 8:22 PM, A B wrote:
> Are there any routines to fill in the gaps in an array. The simplest
> would be by carrying the last known observation forward.
> Or by somehow interpolating the missing values based on the previous
> and next known observations (mean).
The functions `forward_fill` and `backward_fill` in scikits.timeseries
should do what you want. They work also on MaskedArray objects,
meaning that you don't need to have actual series.
The catch is that you need to install scikits.timeseries, of course.
More info here:http://pytseries.sourceforge.net/
More information about the Numpy-discussion