SeriesExtensions Methods |
The SeriesExtensions type exposes the following members.
Name | Description | |
---|---|---|
ContainsKeyK, T | ||
DiffK(SeriesK, Decimal, Int32) |
Returns a series containing difference between a value in the original series and
a value at the specified offset. For example, calling `Series.diff 1 s` returns a
series where previous value is subtracted from the current one.
## Parameters
- `offset` - When positive, subtracts the past values from the current values;
when negative, subtracts the future values from the current values.
- `series` - The input series.
| |
DiffK(SeriesK, Double, Int32) |
Returns a series containing difference between a value in the original series and
a value at the specified offset. For example, calling `Series.diff 1 s` returns a
series where previous value is subtracted from the current one.
## Parameters
- `offset` - When positive, subtracts the past values from the current values;
when negative, subtracts the future values from the current values.
- `series` - The input series.
| |
DiffK(SeriesK, Int32, Int32) |
Returns a series containing difference between a value in the original series and
a value at the specified offset. For example, calling `Series.diff 1 s` returns a
series where previous value is subtracted from the current one.
## Parameters
- `offset` - When positive, subtracts the past values from the current values;
when negative, subtracts the future values from the current values.
- `series` - The input series.
| |
DiffK(SeriesK, Single, Int32) |
Returns a series containing difference between a value in the original series and
a value at the specified offset. For example, calling `Series.diff 1 s` returns a
series where previous value is subtracted from the current one.
## Parameters
- `offset` - When positive, subtracts the past values from the current values;
when negative, subtracts the future values from the current values.
- `series` - The input series.
| |
DropMissingK, V |
Drop missing values from the specified series. The returned series contains
only those keys for which there is a value available in the original one.
## Parameters
- `series` - An input series to be filtered
## Example
let s = series [ 1 => 1.0; 2 => Double.NaN ]
s.DropMissing()
[fsi:val it : Series<int,float> = series [ 1 => 1]
[category:Missing values]
| |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
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) | ||
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
FirstKeyK, V | ||
FirstValueK, V | ||
FlattenK, T |
Collapses a series of OptionalValue<'T> values to just 'T values
| |
GetAllObservationsK, T |
Returns all keys from the sequence, together with the associated (optional)
values. The values are returned using the `OptionalValue<T>` struct which
provides `HasValue` for testing if the value is available.
| |
GetAllValuesK, T |
Returns all (optional) values. The values are returned using the
`OptionalValue<T>` struct which provides `HasValue` for testing
if the value is available.
| |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetObservationsK, T |
Return observations with available values. The operation skips over
all keys with missing values (such as values created from `null`,
`Double.NaN`, or those that are missing due to outer join etc.).
| |
GetSliceK1, K2, V(SeriesTupleK1, K2, V, FSharpOptionK1, FSharpOptionK1, K2) | ||
GetSliceK1, K2, V(SeriesTupleK1, K2, V, K1, FSharpOptionK2, FSharpOptionK2) | ||
GetSliceK1, K2, V(SeriesTupleK1, K2, V, FSharpOptionK1, FSharpOptionK1, FSharpOptionK2, FSharpOptionK2) | ||
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
ChunkK, V | ||
ChunkIntoK, V, U(SeriesK, V, Int32, FuncSeriesK, V, U) | ||
ChunkIntoK1, V, K2, U(SeriesK1, V, Int32, FuncSeriesK1, V, KeyValuePairK2, U) | ||
LastKeyK, V | ||
LastValueK, V | ||
LogK | ||
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
OrderByKeyK, T | Obsolete. | |
PrintK, V | ||
ResampleEquivalenceK, V, a(SeriesK, V, FuncK, a) |
Resample the series based on equivalence class on the keys. A specified function
`keyProj` is used to project keys to another space and the observations for which the
projected keys are equivalent are grouped into chunks. The chunks are then returned
as nested series.
## Parameters
- `series` - An input series to be resampled
- `keyProj` - A function that transforms keys from original space to a new
space (which is then used for grouping based on equivalence)
## Remarks
This operation is only supported on ordered series. The method throws
`InvalidOperationException` when the series is not ordered. For unordered
series, similar functionality can be implemented using `GroupBy`.
[category:Lookup, resampling and scaling]
| |
ResampleEquivalenceK, V, a, b(SeriesK, V, FuncK, a, FuncSeriesK, V, b) |
Resample the series based on equivalence class on the keys. A specified function
`keyProj` is used to project keys to another space and the observations for which the
projected keys are equivalent are grouped into chunks. The chunks are then transformed
to values using the provided function `f`.
## Parameters
- `series` - An input series to be resampled
- `keyProj` - A function that transforms keys from original space to a new
space (which is then used for grouping based on equivalence)
- `aggregate` - A function that is used to collapse a generated chunk into a
single value.
## Remarks
This operation is only supported on ordered series. The method throws
`InvalidOperationException` when the series is not ordered. For unordered
series, similar functionality can be implemented using `GroupBy`.
[category:Lookup, resampling and scaling]
| |
ResampleUniformK, V, a(SeriesK, V, FuncK, a, Funca, a) |
Resample the series based on equivalence class on the keys and also generate values
for all keys of the target space that are between the minimal and maximal key of the
specified series (e.g. generate value for all days in the range covered by the series).
For each equivalence class (e.g. date), select the latest value (with greatest key).
A specified function `keyProj` is used to project keys to another space and `nextKey`
is used to generate all keys in the range.
When there are no values for a (generated) key, then the function attempts to get the
greatest value from the previous smaller chunk (i.e. value for the previous date time).
## Parameters
- `series` - An input series to be resampled
- `keyProj` - A function that transforms keys from original space to a new
space (which is then used for grouping based on equivalence)
- `nextKey` - A function that gets the next key in the transformed space
## Remarks
This operation is only supported on ordered series. The method throws
`InvalidOperationException` when the series is not ordered.
[category:Lookup, resampling and scaling]
| |
ResampleUniformK1, V, K2(SeriesK1, V, FuncK1, K2, FuncK2, K2, Lookup) |
Resample the series based on equivalence class on the keys and also generate values
for all keys of the target space that are between the minimal and maximal key of the
specified series (e.g. generate value for all days in the range covered by the series).
A specified function `keyProj` is used to project keys to another space and `nextKey`
is used to generate all keys in the range. The last value of each chunk is returned.
When there are no values for a (generated) key, then the function attempts to get the
greatest value from the previous smaller chunk (i.e. value for the previous date time).
## Parameters
- `series` - An input series to be resampled
- `fillMode` - When set to `Lookup.NearestSmaller` or `Lookup.NearestGreater`,
the function searches for a nearest available observation in an neighboring chunk.
Otherwise, the function `f` is called with an empty series as an argument.
- `keyProj` - A function that transforms keys from original space to a new
space (which is then used for grouping based on equivalence)
- `nextKey` - A function that gets the next key in the transformed space
## Remarks
This operation is only supported on ordered series. The method throws
`InvalidOperationException` when the series is not ordered.
[category:Lookup, resampling and scaling]
| |
SampleV(SeriesDateTime, V, TimeSpan) |
Finds values at, or near, the specified times in a given series. The operation generates
keys starting from the smallest key of the original series, using the specified `interval`
and then finds nearest smaller values close to such keys. The function generates samples
at, or just before the end of an interval and at, or after, the end of the series.
## Parameters
- `series` - An input series to be resampled
- `interval` - The interval between the individual samples
## Remarks
This operation is only supported on ordered series. The method throws
`InvalidOperationException` when the series is not ordered.
[category:Lookup, resampling and scaling]
| |
SampleV(SeriesDateTimeOffset, V, TimeSpan) |
Finds values at, or near, the specified times in a given series. The operation generates
keys starting from the smallest key of the original series, using the specified `interval`
and then finds nearest smaller values close to such keys. The function generates samples
at, or just before the end of an interval and at, or after, the end of the series.
## Parameters
- `series` - An input series to be resampled
- `interval` - The interval between the individual samples
## Remarks
This operation is only supported on ordered series. The method throws
`InvalidOperationException` when the series is not ordered.
[category:Lookup, resampling and scaling]
| |
SampleV(SeriesDateTime, V, TimeSpan, Direction) |
Finds values at, or near, the specified times in a given series. The operation generates
keys starting from the smallest key of the original series, using the specified `interval`
and then finds nearest smaller values close to such keys according to `dir`.
## Parameters
- `series` - An input series to be resampled
- `interval` - The interval between the individual samples
- `lookup` - Specifies how the lookup based on keys is performed. `Exact` means that the
values at exact keys will be returned; `NearestGreater` returns the nearest greater key value
(starting at the first key) and `NearestSmaller` returns the nearest smaller key value
(starting at most `interval` after the end of the series)
## Remarks
This operation is only supported on ordered series. The method throws
`InvalidOperationException` when the series is not ordered.
[category:Lookup, resampling and scaling]
| |
SampleV(SeriesDateTimeOffset, V, TimeSpan, Direction) |
Finds values at, or near, the specified times in a given series. The operation generates
keys starting from the smallest key of the original series, using the specified `interval`
and then finds nearest smaller values close to such keys according to `dir`.
## Parameters
- `series` - An input series to be resampled
- `interval` - The interval between the individual samples
- `dir` - Specifies how the keys should be generated. `Direction.Forward` means that the
key is the smallest value of each chunk (and so first key of the series is returned and
the last is not, unless it matches exactly _start + k*interval_); `Direction.Backward`
means that the first key is skipped and sample is generated at, or just before the end
of interval and at the end of the series.
## Remarks
This operation is only supported on ordered series. The method throws
`InvalidOperationException` when the series is not ordered.
[category:Lookup, resampling and scaling]
| |
SampleV(SeriesDateTime, V, DateTime, TimeSpan, Direction) |
Finds values at, or near, the specified times in a given series. The operation generates
keys starting at the specified `start` time, using the specified `interval`
and then finds nearest smaller values close to such keys according to `dir`.
## Parameters
- `series` - An input series to be resampled
- `start` - The initial time to be used for sampling
- `interval` - The interval between the individual samples
- `lookup` - Specifies how the lookup based on keys is performed. `Exact` means that the
values at exact keys will be returned; `NearestGreater` returns the nearest greater key value
(starting at the first key) and `NearestSmaller` returns the nearest smaller key value
(starting at most `interval` after the end of the series)
## Remarks
This operation is only supported on ordered series. The method throws
`InvalidOperationException` when the series is not ordered.
[category:Lookup, resampling and scaling]
| |
SampleV(SeriesDateTimeOffset, V, DateTimeOffset, TimeSpan, Direction) |
Finds values at, or near, the specified times in a given series. The operation generates
keys starting at the specified `start` time, using the specified `interval`
and then finds nearest smaller values close to such keys according to `dir`.
## Parameters
- `series` - An input series to be resampled
- `start` - The initial time to be used for sampling
- `interval` - The interval between the individual samples
- `lookup` - Specifies how the lookup based on keys is performed. `Exact` means that the
values at exact keys will be returned; `NearestGreater` returns the nearest greater key value
(starting at the first key) and `NearestSmaller` returns the nearest smaller key value
(starting at most `interval` after the end of the series)
## Remarks
This operation is only supported on ordered series. The method throws
`InvalidOperationException` when the series is not ordered.
[category:Lookup, resampling and scaling]
| |
SampleK, V(SeriesK, V, IEnumerableK) |
Sample an (ordered) series by finding the value at the exact or closest prior key
for some new sequence of keys.
## Parameters
- `series` - An input series to be sampled
- `keys` - The keys at which to sample
## Remarks
This operation is only supported on ordered series. The method throws
`InvalidOperationException` when the series is not ordered.
[category:Lookup, resampling and scaling]
| |
SampleIntoV(SeriesDateTime, V, TimeSpan, Direction, FuncDateTime, FSharpFuncSeriesDateTime, V, Object) |
Performs sampling by time and aggregates chunks obtained by time-sampling into a single
value using a specified function. The operation generates keys starting at the first
key in the source series, using the specified `interval` and then obtains chunks based on
these keys in a fashion similar to the `Series.resample` function.
## Parameters
- `series` - An input series to be resampled
- `interval` - The interval between the individual samples
- `dir` - If this parameter is `Direction.Forward`, then each key is
used as the smallest key in a chunk; for `Direction.Backward`, the keys are
used as the greatest keys in a chunk.
- `aggregate` - A function that is called to aggregate each chunk into a single value.
## Remarks
This operation is only supported on ordered series. The method throws
`InvalidOperationException` when the series is not ordered.
[category:Lookup, resampling and scaling]
| |
SampleIntoV(SeriesDateTimeOffset, V, TimeSpan, Direction, FuncDateTimeOffset, FSharpFuncSeriesDateTimeOffset, V, Object) |
Performs sampling by time and aggregates chunks obtained by time-sampling into a single
value using a specified function. The operation generates keys starting at the first
key in the source series, using the specified `interval` and then obtains chunks based on
these keys in a fashion similar to the `Series.resample` function.
## Parameters
- `series` - An input series to be resampled
- `interval` - The interval between the individual samples
- `dir` - If this parameter is `Direction.Forward`, then each key is
used as the smallest key in a chunk; for `Direction.Backward`, the keys are
used as the greatest keys in a chunk.
- `aggregate` - A function that is called to aggregate each chunk into a single value.
## Remarks
This operation is only supported on ordered series. The method throws
`InvalidOperationException` when the series is not ordered.
[category:Lookup, resampling and scaling]
| |
ShiftK, V |
Returns a series with values shifted by the specified offset. When the offset is
positive, the values are shifted forward and first `offset` keys are dropped. When the
offset is negative, the values are shifted backwards and the last `offset` keys are dropped.
Expressed in pseudo-code:
result[k] = series[k - offset]
## Parameters
- `offset` - Can be both positive and negative number.
- `series` - The input series to be shifted.
## Remarks
If you want to calculate the difference, e.g. `s - (Series.shift 1 s)`, you can
use `Series.diff` which will be a little bit faster.
| |
SortK, V | ||
SortByK, V, V2 | ||
SortByKeyK, T |
Returns a new series whose entries are reordered according to index order
## Parameters
- `series` - An input series to be used
[category:Data structure manipulation]
| |
SortWithK, V | ||
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
TryFirstValueK, V | ||
TryLastValueK, V | ||
WindowK, V | ||
WindowIntoK, V, U(SeriesK, V, Int32, FuncSeriesK, V, U) | ||
WindowIntoK1, V, K2, U(SeriesK1, V, Int32, FuncSeriesK1, V, KeyValuePairK2, U) |