The scikits.timeseries.lib.interpolate submodule contains functions for interpolating and filling missing values in MaskedArray’s and TimeSeries objects.
Forward fills masked values in a 1-d array when there are less maxgap consecutive masked values.
Parameters: | marr : MaskedArray
maxgap : {int}, optional
|
---|
Examples
>>> x = ma.arange(20)
>>> x[(x%5)!=0] = ma.masked
>>> print x
[0 -- -- -- -- 5 -- -- -- -- 10 -- -- -- -- 15 -- -- -- --]
>>> print forward_fill(x)
[0 0 0 0 0 5 5 5 5 5 10 10 10 10 10 15 15 15 15 15]
Backward fills masked values in a 1-d array when there are less than maxgap consecutive masked values.
Parameters: | marr : MaskedArray
maxgap : {int}, optional
|
---|
Examples
>>> x = ma.arange(20)
>>> x[(x%5)!=0] = ma.masked
>>> print x
[0 -- -- -- -- 5 -- -- -- -- 10 -- -- -- -- 15 -- -- -- --]
>>> print backward_fill(x)
[0 5 5 5 5 5 10 10 10 10 10 15 15 15 15 15 0 0 0 0]
Interpolates masked values in an array according to the given method.
Parameters: | marr : MaskedArray
kind : {‘constant’, ‘linear’, ‘cubic’, quintic’}, optional
|
---|