SeriesExtensionsFillMissing Method |
Name | Description | |
---|---|---|
FillMissingK, T(SeriesK, T, Direction) |
Fill missing values in the series with the nearest available value
(using the specified direction). The default direction is `Direction.Backward`.
Note that the series may still contain missing values after call to this
function. This operation can only be used on ordered series.
## Example
let sample = Series.ofValues [ Double.NaN; 1.0; Double.NaN; 3.0 ]
// Returns a series consisting of [1; 1; 3; 3]
sample.FillMissing(Direction.Backward)
// Returns a series consisting of [<missing>; 1; 1; 3]
sample.FillMissing(Direction.Forward)
## Parameters
- `direction` - Specifies the direction used when searching for
the nearest available value. `Backward` means that we want to
look for the first value with a smaller key while `Forward` searches
for the nearest greater key.
[category:Missing values]
| |
FillMissingK, T(SeriesK, T, FuncK, T) |
Fill missing values in the series using the specified function.
The specified function is called with all keys for which the series
does not contain value and the result of the call is used in place
of the missing value.
## Parameters
- `series` - An input series that is to be filled
- `filler` - A function that takes key `K` and generates a value to be
used in a place where the original series contains a missing value.
## Remarks
This function can be used to implement more complex interpolation.
For example see [handling missing values in the tutorial](../frame.html#missing)
[category:Missing values]
| |
FillMissingK, T(SeriesK, T, T) |
Fill missing values in the series with a constant value.
## Parameters
- `series` - An input series that is to be filled
- `value` - A constant value that is used to fill all missing values
[category:Missing values]
| |
FillMissingK, T(SeriesK, T, K, K, Direction) |