Logo Deedle

SeriesExtensions Type

The type implements C# and F# extension methods for the Series<'K, 'V> type. The members are automatically available when you import the `Deedle` namespace. The type contains object-oriented counterparts to most of the functionality from the `Series` module.

Table of contents

Other module members

Static members

Static member Description

SeriesExtensions.Chunk(series, size)

Full Usage: SeriesExtensions.Chunk(series, size)

Parameters:
    series : Series<'K, 'V>
    size : int

Returns: Series<'K, Series<'K, 'V>>
Type parameters: 'K, 'V (requires equality)
series : Series<'K, 'V>
size : int
Returns: Series<'K, Series<'K, 'V>>

SeriesExtensions.ChunkInto(series, size, reduce)

Full Usage: SeriesExtensions.ChunkInto(series, size, reduce)

Parameters:
Returns: Series<'K, 'U>
Type parameters: 'K, 'V, 'U (requires equality)
series : Series<'K, 'V>
size : int
reduce : Func<Series<'K, 'V>, 'U>
Returns: Series<'K, 'U>

SeriesExtensions.ChunkInto(series, size, selector)

Full Usage: SeriesExtensions.ChunkInto(series, size, selector)

Parameters:
Returns: Series<'K2, 'U>
Type parameters: 'K1, 'V, 'K2, 'U (requires equality and equality)
series : Series<'K1, 'V>
size : int
selector : Func<Series<'K1, 'V>, KeyValuePair<'K2, 'U>>
Returns: Series<'K2, 'U>

SeriesExtensions.ChunkWhile(series, cond)

Full Usage: SeriesExtensions.ChunkWhile(series, cond)

Parameters:
    series : Series<'K, 'V> - The input series to be chunked.
    cond : Func<'K, 'K, bool> - A function that is called with the first and last key of a chunk. As long as the function returns true, the chunk continues growing. When it returns false, the chunk ends and a new one is started.

Returns: Series<'K, Series<'K, 'V>>
Type parameters: 'K, 'V (requires equality)

Splits a series into non-overlapping chunks. A new chunk is started when the condition on consecutive keys is no longer met. Returns a series of nested series, one per chunk.

series : Series<'K, 'V>

The input series to be chunked.

cond : Func<'K, 'K, bool>

A function that is called with the first and last key of a chunk. As long as the function returns true, the chunk continues growing. When it returns false, the chunk ends and a new one is started.

Returns: Series<'K, Series<'K, 'V>>

SeriesExtensions.ChunkWhileInto(series, cond, reduce)

Full Usage: SeriesExtensions.ChunkWhileInto(series, cond, reduce)

Parameters:
    series : Series<'K, 'V> - The input series to be chunked.
    cond : Func<'K, 'K, bool> - A function that is called with the first and last key of a chunk. As long as the function returns true, the chunk continues growing. When it returns false, the chunk ends and a new one is started.
    reduce : Func<Series<'K, 'V>, 'U> - A function that aggregates each chunk series into a single value.

Returns: Series<'K, 'U>
Type parameters: 'K, 'V, 'U (requires equality)

Splits a series into non-overlapping chunks. A new chunk is started when the condition on consecutive keys is no longer met. Each chunk is then aggregated into a single value using the provided reduce function.

series : Series<'K, 'V>

The input series to be chunked.

cond : Func<'K, 'K, bool>

A function that is called with the first and last key of a chunk. As long as the function returns true, the chunk continues growing. When it returns false, the chunk ends and a new one is started.

reduce : Func<Series<'K, 'V>, 'U>

A function that aggregates each chunk series into a single value.

Returns: Series<'K, 'U>

SeriesExtensions.ContainsKey(series, key)

Full Usage: SeriesExtensions.ContainsKey(series, key)

Parameters:
    series : Series<'K, 'T>
    key : 'K

Returns: bool
Type parameters: 'K, 'T (requires equality)
series : Series<'K, 'T>
key : 'K
Returns: bool

SeriesExtensions.Diff(series, offset)

Full Usage: SeriesExtensions.Diff(series, offset)

Parameters:
Returns: Series<'K, TimeSpan>
Type parameters: 'K (requires equality)
 Returns a series containing the difference (as ) between
 a  value in the original series and a value at the
 specified offset. For example, calling Diff(1) returns a series where the
 previous timestamp is subtracted from the current one:

     result[k] = series[k] - series[k - offset]

 ## 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.
series : Series<'K, DateTimeOffset>
offset : int
Returns: Series<'K, TimeSpan>

SeriesExtensions.Diff(series, offset)

Full Usage: SeriesExtensions.Diff(series, offset)

Parameters:
Returns: Series<'K, TimeSpan>
Type parameters: 'K (requires equality)
 Returns a series containing the difference (as ) between
 a  value in the original series and a value at the
 specified offset. For example, calling Diff(1) returns a series where the
 previous timestamp is subtracted from the current one:

     result[k] = series[k] - series[k - offset]

 ## 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.
series : Series<'K, DateTime>
offset : int
Returns: Series<'K, TimeSpan>

SeriesExtensions.Diff(series, offset)

Full Usage: SeriesExtensions.Diff(series, offset)

Parameters:
    series : Series<'K, int> - The input series.
    offset : int - When positive, subtracts the past values from the current values; when negative, subtracts the future values from the current values.

Returns: Series<'K, int>
Type parameters: 'K (requires equality)

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.

series : Series<'K, int>

The input series.

offset : int

When positive, subtracts the past values from the current values; when negative, subtracts the future values from the current values.

Returns: Series<'K, int>

SeriesExtensions.Diff(series, offset)

Full Usage: SeriesExtensions.Diff(series, offset)

Parameters:
    series : Series<'K, decimal> - The input series.
    offset : int - When positive, subtracts the past values from the current values; when negative, subtracts the future values from the current values.

Returns: Series<'K, decimal>
Type parameters: 'K (requires equality)

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.

series : Series<'K, decimal>

The input series.

offset : int

When positive, subtracts the past values from the current values; when negative, subtracts the future values from the current values.

Returns: Series<'K, decimal>

SeriesExtensions.Diff(series, offset)

Full Usage: SeriesExtensions.Diff(series, offset)

Parameters:
    series : Series<'K, float32> - The input series.
    offset : int - When positive, subtracts the past values from the current values; when negative, subtracts the future values from the current values.

Returns: Series<'K, float32>
Type parameters: 'K (requires equality)

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.

series : Series<'K, float32>

The input series.

offset : int

When positive, subtracts the past values from the current values; when negative, subtracts the future values from the current values.

Returns: Series<'K, float32>

SeriesExtensions.Diff(series, offset)

Full Usage: SeriesExtensions.Diff(series, offset)

Parameters:
    series : Series<'K, float> - The input series.
    offset : int - When positive, subtracts the past values from the current values; when negative, subtracts the future values from the current values.

Returns: Series<'K, float>
Type parameters: 'K (requires equality)

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.

series : Series<'K, float>

The input series.

offset : int

When positive, subtracts the past values from the current values; when negative, subtracts the future values from the current values.

Returns: Series<'K, float>

SeriesExtensions.FillMissing(series, startKey, endKey, ?direction)

Full Usage: SeriesExtensions.FillMissing(series, startKey, endKey, ?direction)

Parameters:
Returns: Series<'K, 'T>
Type parameters: 'K, 'T (requires equality)
series : Series<'K, 'T>
startKey : 'K
endKey : 'K
?direction : Direction
Returns: Series<'K, 'T>

SeriesExtensions.FirstKey(series)

Full Usage: SeriesExtensions.FirstKey(series)

Parameters:
Returns: 'K
Type parameters: 'K, 'V (requires equality)
series : Series<'K, 'V>
Returns: 'K

SeriesExtensions.FirstValue(series)

Full Usage: SeriesExtensions.FirstValue(series)

Parameters:
Returns: 'V
Type parameters: 'K, 'V (requires equality)
series : Series<'K, 'V>
Returns: 'V

SeriesExtensions.Flatten(series)

Full Usage: SeriesExtensions.Flatten(series)

Parameters:
Returns: Series<'K, 'T>
Type parameters: 'K, 'T (requires equality)

Collapses a series of OptionalValue<'T> values to just 'T values

series : Series<'K, 'T opt>
Returns: Series<'K, 'T>

SeriesExtensions.GetAllObservations(series)

Full Usage: SeriesExtensions.GetAllObservations(series)

Parameters:
Returns: KeyValuePair<'K, OptionalValue<'T>> seq
Type parameters: 'K, 'T (requires equality)

Returns all keys from the sequence, together with the associated (optional) values. The values are returned using the `OptionalValue` struct which provides `HasValue` for testing if the value is available.

series : Series<'K, 'T>
Returns: KeyValuePair<'K, OptionalValue<'T>> seq

SeriesExtensions.GetAllValues(series)

Full Usage: SeriesExtensions.GetAllValues(series)

Parameters:
Returns: OptionalValue<'T> seq
Type parameters: 'K, 'T (requires equality)

Returns all (optional) values. The values are returned using the `OptionalValue` struct which provides `HasValue` for testing if the value is available.

series : Series<'K, 'T>
Returns: OptionalValue<'T> seq

SeriesExtensions.GetObservations(series)

Full Usage: SeriesExtensions.GetObservations(series)

Parameters:
Returns: KeyValuePair<'K, 'T> seq
Type parameters: 'K, 'T (requires equality)

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.).

series : Series<'K, 'T>
Returns: KeyValuePair<'K, 'T> seq

SeriesExtensions.GetSlice(series, k1, lo2, hi2)

Full Usage: SeriesExtensions.GetSlice(series, k1, lo2, hi2)

Parameters:
    series : Series<('K1 * 'K2), 'V>
    k1 : 'K1
    lo2 : 'K2 option
    hi2 : 'K2 option

Returns: Series<('K1 * 'K2), 'V>
Type parameters: 'K1, 'K2, 'V (requires equality and equality)
series : Series<('K1 * 'K2), 'V>
k1 : 'K1
lo2 : 'K2 option
hi2 : 'K2 option
Returns: Series<('K1 * 'K2), 'V>

SeriesExtensions.GetSlice(series, lo1, hi1, k2)

Full Usage: SeriesExtensions.GetSlice(series, lo1, hi1, k2)

Parameters:
    series : Series<('K1 * 'K2), 'V>
    lo1 : 'K1 option
    hi1 : 'K1 option
    k2 : 'K2

Returns: Series<('K1 * 'K2), 'V>
Type parameters: 'K1, 'K2, 'V (requires equality and equality)
series : Series<('K1 * 'K2), 'V>
lo1 : 'K1 option
hi1 : 'K1 option
k2 : 'K2
Returns: Series<('K1 * 'K2), 'V>

SeriesExtensions.GetSlice(series, lo1, hi1, lo2, hi2)

Full Usage: SeriesExtensions.GetSlice(series, lo1, hi1, lo2, hi2)

Parameters:
    series : Series<('K1 * 'K2), 'V>
    lo1 : 'K1 option
    hi1 : 'K1 option
    lo2 : 'K2 option
    hi2 : 'K2 option

Returns: Series<('K1 * 'K2), 'V>
Type parameters: 'K1, 'K2, 'V (requires equality and equality)
series : Series<('K1 * 'K2), 'V>
lo1 : 'K1 option
hi1 : 'K1 option
lo2 : 'K2 option
hi2 : 'K2 option
Returns: Series<('K1 * 'K2), 'V>

SeriesExtensions.LastKey(series)

Full Usage: SeriesExtensions.LastKey(series)

Parameters:
Returns: 'K
Type parameters: 'K, 'V (requires equality)
series : Series<'K, 'V>
Returns: 'K

SeriesExtensions.LastValue(series)

Full Usage: SeriesExtensions.LastValue(series)

Parameters:
Returns: 'V
Type parameters: 'K, 'V (requires equality)
series : Series<'K, 'V>
Returns: 'V

SeriesExtensions.Log(series)

Full Usage: SeriesExtensions.Log(series)

Parameters:
Returns: Series<'K, float>
Type parameters: 'K (requires equality)
series : Series<'K, float>
Returns: Series<'K, float>

SeriesExtensions.Ntile(series, groups)

Full Usage: SeriesExtensions.Ntile(series, groups)

Parameters:
    series : Series<'K, 'V>
    groups : int

Returns: Series<'K, int>
Type parameters: 'K, 'V (requires equality and comparison)

Divides the series values into the specified number of equal-sized buckets numbered 0 to groups - 1. Bucket 0 contains the smallest values.

series : Series<'K, 'V>
groups : int
Returns: Series<'K, int>

SeriesExtensions.PairwiseWith(series, f)

Full Usage: SeriesExtensions.PairwiseWith(series, f)

Parameters:
    series : Series<'K, 'T> - The input series.
    f : Func<'K, 'T, 'T, 'U> - A function that is called for each pair of consecutive values to produce the result value. The arguments are the key, the previous value, and the current value.

Returns: Series<'K, 'U>
Type parameters: 'K, 'T, 'U (requires equality)

Returns a series containing the result of applying the specified function to each pair of consecutive values in the series. The function receives the key and both the preceding and the current value.

series : Series<'K, 'T>

The input series.

f : Func<'K, 'T, 'T, 'U>

A function that is called for each pair of consecutive values to produce the result value. The arguments are the key, the previous value, and the current value.

Returns: Series<'K, 'U>

SeriesExtensions.PctChange(series, offset)

Full Usage: SeriesExtensions.PctChange(series, offset)

Parameters:
    series : Series<'K, decimal> - The input series.
    offset : int - When positive, computes change from past values; when negative, computes change relative to future values.

Returns: Series<'K, decimal>
Type parameters: 'K (requires equality)

Returns a series containing the percentage change between a value in the original series and a value at the specified offset. For example, calling PctChange(1) returns a series where each value is the relative change from the previous value.

series : Series<'K, decimal>

The input series.

offset : int

When positive, computes change from past values; when negative, computes change relative to future values.

Returns: Series<'K, decimal>

SeriesExtensions.PctChange(series, offset)

Full Usage: SeriesExtensions.PctChange(series, offset)

Parameters:
    series : Series<'K, float32> - The input series.
    offset : int - When positive, computes change from past values; when negative, computes change relative to future values.

Returns: Series<'K, float32>
Type parameters: 'K (requires equality)

Returns a series containing the percentage change between a value in the original series and a value at the specified offset. For example, calling PctChange(1) returns a series where each value is the relative change from the previous value.

series : Series<'K, float32>

The input series.

offset : int

When positive, computes change from past values; when negative, computes change relative to future values.

Returns: Series<'K, float32>

SeriesExtensions.PctChange(series, offset)

Full Usage: SeriesExtensions.PctChange(series, offset)

Parameters:
    series : Series<'K, float> - The input series.
    offset : int - When positive, computes change from past values; when negative, computes change relative to future values.

Returns: Series<'K, float>
Type parameters: 'K (requires equality)

Returns a series containing the percentage change between a value in the original series and a value at the specified offset. For example, calling PctChange(1) returns a series where each value is the relative change from the previous value: result[k] = (series[k] - series[k - offset]) / series[k - offset] This is commonly used in financial analysis to compute returns (e.g. daily stock returns).

series : Series<'K, float>

The input series.

offset : int

When positive, computes change from past values; when negative, computes change relative to future values.

Returns: Series<'K, float>

SeriesExtensions.Print(series)

Full Usage: SeriesExtensions.Print(series)

Parameters:
Type parameters: 'K, 'V (requires equality)
series : Series<'K, 'V>

SeriesExtensions.Rank(series)

Full Usage: SeriesExtensions.Rank(series)

Parameters:
Returns: Series<'K, int>
Type parameters: 'K, 'V (requires equality and comparison)

Returns a new series containing the dense rank of each value. The rank is 1-based: the smallest value receives rank 1. Ties receive the same rank.

series : Series<'K, 'V>
Returns: Series<'K, int>

SeriesExtensions.RankWith(series, cmp)

Full Usage: SeriesExtensions.RankWith(series, cmp)

Parameters:
Returns: Series<'K, int>
Type parameters: 'K, 'V (requires equality)

Returns a new series containing the dense rank of each value, using the specified comparer to determine ordering. The rank is 1-based. Ties receive the same rank.

series : Series<'K, 'V>
cmp : Comparer<'V>
Returns: Series<'K, int>

SeriesExtensions.Shift(series, offset)

Full Usage: SeriesExtensions.Shift(series, offset)

Parameters:
    series : Series<'K, 'V> - The input series to be shifted.
    offset : int - Can be both positive and negative number.

Returns: Series<'K, 'V>
Type parameters: 'K, 'V (requires equality)

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]

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.

series : Series<'K, 'V>

The input series to be shifted.

offset : int

Can be both positive and negative number.

Returns: Series<'K, 'V>

SeriesExtensions.Sort(series)

Full Usage: SeriesExtensions.Sort(series)

Parameters:
Returns: Series<'K, 'V>
Type parameters: 'K, 'V (requires equality and comparison)
series : Series<'K, 'V>
Returns: Series<'K, 'V>

SeriesExtensions.SortBy(series, f)

Full Usage: SeriesExtensions.SortBy(series, f)

Parameters:
Returns: Series<'K, 'V>
Type parameters: 'K, 'V, 'V2 (requires equality and comparison)
series : Series<'K, 'V>
f : Func<'V, 'V2>
Returns: Series<'K, 'V>

SeriesExtensions.SortWith(series, cmp)

Full Usage: SeriesExtensions.SortWith(series, cmp)

Parameters:
Returns: Series<'K, 'V>
Type parameters: 'K, 'V (requires equality)
series : Series<'K, 'V>
cmp : Comparer<'V>
Returns: Series<'K, 'V>

SeriesExtensions.TryFirstValue(series)

Full Usage: SeriesExtensions.TryFirstValue(series)

Parameters:
Returns: 'V option
Type parameters: 'K, 'V (requires equality)
series : Series<'K, 'V>
Returns: 'V option

SeriesExtensions.TryLastValue(series)

Full Usage: SeriesExtensions.TryLastValue(series)

Parameters:
Returns: 'V option
Type parameters: 'K, 'V (requires equality)
series : Series<'K, 'V>
Returns: 'V option

SeriesExtensions.Window(series, size)

Full Usage: SeriesExtensions.Window(series, size)

Parameters:
    series : Series<'K, 'V>
    size : int

Returns: Series<'K, Series<'K, 'V>>
Type parameters: 'K, 'V (requires equality)
series : Series<'K, 'V>
size : int
Returns: Series<'K, Series<'K, 'V>>

SeriesExtensions.WindowInto(series, size, reduce)

Full Usage: SeriesExtensions.WindowInto(series, size, reduce)

Parameters:
Returns: Series<'K, 'U>
Type parameters: 'K, 'V, 'U (requires equality)
series : Series<'K, 'V>
size : int
reduce : Func<Series<'K, 'V>, 'U>
Returns: Series<'K, 'U>

SeriesExtensions.WindowInto(series, size, selector)

Full Usage: SeriesExtensions.WindowInto(series, size, selector)

Parameters:
Returns: Series<'K2, 'U>
Type parameters: 'K1, 'V, 'K2, 'U (requires equality and equality)
series : Series<'K1, 'V>
size : int
selector : Func<Series<'K1, 'V>, KeyValuePair<'K2, 'U>>
Returns: Series<'K2, 'U>

SeriesExtensions.WindowWhile(series, cond)

Full Usage: SeriesExtensions.WindowWhile(series, cond)

Parameters:
    series : Series<'K, 'V> - The input series to be windowed.
    cond : Func<'K, 'K, bool> - A function that is called with the first and last key of a window. As long as the function returns true, the window continues growing. When it returns false, the window ends and a new one is started.

Returns: Series<'K, Series<'K, 'V>>
Type parameters: 'K, 'V (requires equality)

Creates a series of sliding windows. The windows are created based on the specified condition: a new window is started when the condition on consecutive keys is no longer met. Returns a series of nested series, one per window.

series : Series<'K, 'V>

The input series to be windowed.

cond : Func<'K, 'K, bool>

A function that is called with the first and last key of a window. As long as the function returns true, the window continues growing. When it returns false, the window ends and a new one is started.

Returns: Series<'K, Series<'K, 'V>>

SeriesExtensions.WindowWhileInto(series, cond, reduce)

Full Usage: SeriesExtensions.WindowWhileInto(series, cond, reduce)

Parameters:
    series : Series<'K, 'V> - The input series to be windowed.
    cond : Func<'K, 'K, bool> - A function that is called with the first and last key of a window. As long as the function returns true, the window continues growing. When it returns false, the window ends and a new one is started.
    reduce : Func<Series<'K, 'V>, 'U> - A function that aggregates each window series into a single value.

Returns: Series<'K, 'U>
Type parameters: 'K, 'V, 'U (requires equality)

Creates a series of sliding windows. The windows are created based on the specified condition: a new window is started when the condition on consecutive keys is no longer met. Each window is then aggregated into a single value using the provided reduce function.

series : Series<'K, 'V>

The input series to be windowed.

cond : Func<'K, 'K, bool>

A function that is called with the first and last key of a window. As long as the function returns true, the window continues growing. When it returns false, the window ends and a new one is started.

reduce : Func<Series<'K, 'V>, 'U>

A function that aggregates each window series into a single value.

Returns: Series<'K, 'U>

SeriesExtensions.ZipAlignInto(series1, series2, op, kind, lookup)

Full Usage: SeriesExtensions.ZipAlignInto(series1, series2, op, kind, lookup)

Parameters:
    series1 : Series<'K, 'V1> - The first series to align and combine.
    series2 : Series<'K, 'V2> - The second series to align and combine.
    op : Func<OptionalValue<'V1>, OptionalValue<'V2>, OptionalValue<'R>> - A function receiving optional values for each key; return an empty OptionalValue to produce a missing value.
    kind : JoinKind - Specifies the join kind (inner, outer, left, right).
    lookup : Lookup - Specifies how keys are looked up in ordered series.

Returns: Series<'K, 'R>
Type parameters: 'K, 'V1, 'V2, 'R (requires equality)

Align two series using the specified join kind and key lookup, and combine matching values using the provided function. When either value is missing (outer-join key present in only one series), the corresponding OptionalValue{T} will have HasValue = false. Return an OptionalValue with HasValue = false to produce a missing value in the result.

series1 : Series<'K, 'V1>

The first series to align and combine.

series2 : Series<'K, 'V2>

The second series to align and combine.

op : Func<OptionalValue<'V1>, OptionalValue<'V2>, OptionalValue<'R>>

A function receiving optional values for each key; return an empty OptionalValue to produce a missing value.

kind : JoinKind

Specifies the join kind (inner, outer, left, right).

lookup : Lookup

Specifies how keys are looked up in ordered series.

Returns: Series<'K, 'R>

SeriesExtensions.ZipInner(series1, series2)

Full Usage: SeriesExtensions.ZipInner(series1, series2)

Parameters:
    series1 : Series<'K, 'V1> - The first series to zip.
    series2 : Series<'K, 'V2> - The second series to zip with.

Returns: Series<'K, ('V1 * 'V2)>
Type parameters: 'K, 'V1, 'V2 (requires equality)

Align two series using inner join and exact key matching. The result is a series of tuples containing the values from both series for each shared key. Keys that are present in only one of the series are dropped.

series1 : Series<'K, 'V1>

The first series to zip.

series2 : Series<'K, 'V2>

The second series to zip with.

Returns: Series<'K, ('V1 * 'V2)>

SeriesExtensions.ZipInto(series1, series2, op)

Full Usage: SeriesExtensions.ZipInto(series1, series2, op)

Parameters:
    series1 : Series<'K, 'V1> - The first series to combine.
    series2 : Series<'K, 'V2> - The second series to combine with.
    op : Func<'V1, 'V2, 'R> - A function that combines corresponding values.

Returns: Series<'K, 'R>
Type parameters: 'K, 'V1, 'V2, 'R (requires equality)

Align two series using inner join and exact key matching, and combine matching values using the provided function. Keys that are present in only one of the series are dropped (inner-join semantics). This is a convenience alternative to the arithmetic operators for series with custom element types that have their own operators defined.

series1 : Series<'K, 'V1>

The first series to combine.

series2 : Series<'K, 'V2>

The second series to combine with.

op : Func<'V1, 'V2, 'R>

A function that combines corresponding values.

Returns: Series<'K, 'R>

Data structure manipulation

Static members

Static member Description

SeriesExtensions.SortByKey(series)

Full Usage: SeriesExtensions.SortByKey(series)

Parameters:
    series : Series<'K, 'T> - An input series to be used

Returns: Series<'K, 'T>
Type parameters: 'K, 'T (requires equality)

Returns a new series whose entries are reordered according to index order

series : Series<'K, 'T>

An input series to be used

Returns: Series<'K, 'T>

Lookup, resampling and scaling

Static members

Static member Description

SeriesExtensions.ResampleEquivalence(series, keyProj, aggregate)

Full Usage: SeriesExtensions.ResampleEquivalence(series, keyProj, aggregate)

Parameters:
    series : Series<'K, 'V> - An input series to be resampled
    keyProj : Func<'K, 'a> - A function that transforms keys from original space to a new space (which is then used for grouping based on equivalence)
    aggregate : Func<Series<'K, 'V>, 'b> - A function that is used to collapse a generated chunk into a single value.

Returns: Series<'a, 'b>
Type parameters: 'K, 'V, 'a, 'b (requires equality and equality)

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`.

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`.

series : Series<'K, 'V>

An input series to be resampled

keyProj : Func<'K, 'a>

A function that transforms keys from original space to a new space (which is then used for grouping based on equivalence)

aggregate : Func<Series<'K, 'V>, 'b>

A function that is used to collapse a generated chunk into a single value.

Returns: Series<'a, 'b>

SeriesExtensions.ResampleEquivalence(series, keyProj)

Full Usage: SeriesExtensions.ResampleEquivalence(series, keyProj)

Parameters:
    series : Series<'K, 'V> - An input series to be resampled
    keyProj : Func<'K, 'a> - A function that transforms keys from original space to a new space (which is then used for grouping based on equivalence)

Returns: Series<'a, Series<'K, 'V>>
Type parameters: 'K, 'V, 'a (requires equality and equality)

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.

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`.

series : Series<'K, 'V>

An input series to be resampled

keyProj : Func<'K, 'a>

A function that transforms keys from original space to a new space (which is then used for grouping based on equivalence)

Returns: Series<'a, Series<'K, 'V>>

SeriesExtensions.ResampleUniform(series, keyProj, nextKey, fillMode)

Full Usage: SeriesExtensions.ResampleUniform(series, keyProj, nextKey, fillMode)

Parameters:
    series : Series<'K1, 'V> - An input series to be resampled
    keyProj : Func<'K1, 'K2> - A function that transforms keys from original space to a new space (which is then used for grouping based on equivalence)
    nextKey : Func<'K2, 'K2> - A function that gets the next key in the transformed space
    fillMode : Lookup - 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.

Returns: Series<'K2, 'V>
Type parameters: 'K1, 'V, 'K2 (requires equality and comparison)

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).

This operation is only supported on ordered series. The method throws `InvalidOperationException` when the series is not ordered.

series : Series<'K1, 'V>

An input series to be resampled

keyProj : Func<'K1, 'K2>

A function that transforms keys from original space to a new space (which is then used for grouping based on equivalence)

nextKey : Func<'K2, 'K2>

A function that gets the next key in the transformed space

fillMode : Lookup

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.

Returns: Series<'K2, 'V>

SeriesExtensions.ResampleUniform(series, keyProj, nextKey)

Full Usage: SeriesExtensions.ResampleUniform(series, keyProj, nextKey)

Parameters:
    series : Series<'K, 'V> - An input series to be resampled
    keyProj : Func<'K, 'a> - A function that transforms keys from original space to a new space (which is then used for grouping based on equivalence)
    nextKey : Func<'a, 'a> - A function that gets the next key in the transformed space

Returns: Series<'a, 'V>
Type parameters: 'K, 'V, 'a (requires equality and comparison)

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).

This operation is only supported on ordered series. The method throws `InvalidOperationException` when the series is not ordered.

series : Series<'K, 'V>

An input series to be resampled

keyProj : Func<'K, 'a>

A function that transforms keys from original space to a new space (which is then used for grouping based on equivalence)

nextKey : Func<'a, 'a>

A function that gets the next key in the transformed space

Returns: Series<'a, 'V>

SeriesExtensions.Sample(series, interval)

Full Usage: SeriesExtensions.Sample(series, interval)

Parameters:
Returns: Series<DateTimeOffset, 'V>
Type parameters: 'V

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.

This operation is only supported on ordered series. The method throws `InvalidOperationException` when the series is not ordered.

series : Series<DateTimeOffset, 'V>

An input series to be resampled

interval : TimeSpan

The interval between the individual samples

Returns: Series<DateTimeOffset, 'V>

SeriesExtensions.Sample(series, interval)

Full Usage: SeriesExtensions.Sample(series, interval)

Parameters:
    series : Series<DateTime, 'V> - An input series to be resampled
    interval : TimeSpan - The interval between the individual samples

Returns: Series<DateTime, 'V>
Type parameters: 'V

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.

This operation is only supported on ordered series. The method throws `InvalidOperationException` when the series is not ordered.

series : Series<DateTime, 'V>

An input series to be resampled

interval : TimeSpan

The interval between the individual samples

Returns: Series<DateTime, 'V>

SeriesExtensions.Sample(series, interval, dir)

Full Usage: SeriesExtensions.Sample(series, interval, dir)

Parameters:
    series : Series<DateTimeOffset, 'V> - An input series to be resampled
    interval : TimeSpan - The interval between the individual samples
    dir : Direction - 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.

Returns: Series<DateTimeOffset, 'V>
Type parameters: 'V

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`.

This operation is only supported on ordered series. The method throws `InvalidOperationException` when the series is not ordered.

series : Series<DateTimeOffset, 'V>

An input series to be resampled

interval : TimeSpan

The interval between the individual samples

dir : Direction

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.

Returns: Series<DateTimeOffset, 'V>

SeriesExtensions.Sample(series, interval, dir)

Full Usage: SeriesExtensions.Sample(series, interval, dir)

Parameters:
    series : Series<DateTime, 'V> - An input series to be resampled
    interval : TimeSpan - The interval between the individual samples
    dir : Direction - Specifies the direction. `Backward` means that we want to look for the first value with a smaller key while `Forward` searches for the nearest greater key.

Returns: Series<DateTime, 'V>
Type parameters: 'V

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`.

This operation is only supported on ordered series. The method throws `InvalidOperationException` when the series is not ordered.

series : Series<DateTime, 'V>

An input series to be resampled

interval : TimeSpan

The interval between the individual samples

dir : Direction

Specifies the direction. `Backward` means that we want to look for the first value with a smaller key while `Forward` searches for the nearest greater key.

Returns: Series<DateTime, 'V>

SeriesExtensions.Sample(series, start, interval, dir)

Full Usage: SeriesExtensions.Sample(series, start, interval, dir)

Parameters:
    series : Series<DateTimeOffset, 'V> - An input series to be resampled
    start : DateTimeOffset - The initial time to be used for sampling
    interval : TimeSpan - The interval between the individual samples
    dir : Direction - Specifies the direction. `Backward` means that we want to look for the first value with a smaller key while `Forward` searches for the nearest greater key.

Returns: Series<DateTimeOffset, 'V>
Type parameters: 'V

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`.

This operation is only supported on ordered series. The method throws `InvalidOperationException` when the series is not ordered.

series : Series<DateTimeOffset, 'V>

An input series to be resampled

start : DateTimeOffset

The initial time to be used for sampling

interval : TimeSpan

The interval between the individual samples

dir : Direction

Specifies the direction. `Backward` means that we want to look for the first value with a smaller key while `Forward` searches for the nearest greater key.

Returns: Series<DateTimeOffset, 'V>

SeriesExtensions.Sample(series, start, interval, dir)

Full Usage: SeriesExtensions.Sample(series, start, interval, dir)

Parameters:
    series : Series<DateTime, 'V> - An input series to be resampled
    start : DateTime - The initial time to be used for sampling
    interval : TimeSpan - The interval between the individual samples
    dir : Direction - Specifies the direction. `Backward` means that we want to look for the first value with a smaller key while `Forward` searches for the nearest greater key.

Returns: Series<DateTime, 'V>
Type parameters: 'V

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`.

This operation is only supported on ordered series. The method throws `InvalidOperationException` when the series is not ordered.

series : Series<DateTime, 'V>

An input series to be resampled

start : DateTime

The initial time to be used for sampling

interval : TimeSpan

The interval between the individual samples

dir : Direction

Specifies the direction. `Backward` means that we want to look for the first value with a smaller key while `Forward` searches for the nearest greater key.

Returns: Series<DateTime, 'V>

SeriesExtensions.Sample(series, keys)

Full Usage: SeriesExtensions.Sample(series, keys)

Parameters:
    series : Series<'K, 'V> - An input series to be sampled
    keys : 'K seq - The keys at which to sample

Returns: Series<'K, 'V>
Type parameters: 'K, 'V (requires equality)

Sample an (ordered) series by finding the value at the exact or closest prior key for some new sequence of keys.

This operation is only supported on ordered series. The method throws `InvalidOperationException` when the series is not ordered.

series : Series<'K, 'V>

An input series to be sampled

keys : 'K seq

The keys at which to sample

Returns: Series<'K, 'V>

SeriesExtensions.SampleInto(series, interval, dir, aggregate)

Full Usage: SeriesExtensions.SampleInto(series, interval, dir, aggregate)

Parameters:
    series : Series<DateTimeOffset, 'V> - An input series to be resampled
    interval : TimeSpan - The interval between the individual samples
    dir : Direction - 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 : Func<DateTimeOffset, (Series<DateTimeOffset, 'V> -> obj)> - A function that is called to aggregate each chunk into a single value.

Returns: Series<DateTimeOffset, obj>
Type parameters: 'V

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.

This operation is only supported on ordered series. The method throws `InvalidOperationException` when the series is not ordered.

series : Series<DateTimeOffset, 'V>

An input series to be resampled

interval : TimeSpan

The interval between the individual samples

dir : Direction

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 : Func<DateTimeOffset, (Series<DateTimeOffset, 'V> -> obj)>

A function that is called to aggregate each chunk into a single value.

Returns: Series<DateTimeOffset, obj>

SeriesExtensions.SampleInto(series, interval, dir, aggregate)

Full Usage: SeriesExtensions.SampleInto(series, interval, dir, aggregate)

Parameters:
    series : Series<DateTime, 'V> - An input series to be resampled
    interval : TimeSpan - The interval between the individual samples
    dir : Direction - 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 : Func<DateTime, (Series<DateTime, 'V> -> obj)> - A function that is called to aggregate each chunk into a single value.

Returns: Series<DateTime, obj>
Type parameters: 'V

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.

This operation is only supported on ordered series. The method throws `InvalidOperationException` when the series is not ordered.

series : Series<DateTime, 'V>

An input series to be resampled

interval : TimeSpan

The interval between the individual samples

dir : Direction

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 : Func<DateTime, (Series<DateTime, 'V> -> obj)>

A function that is called to aggregate each chunk into a single value.

Returns: Series<DateTime, obj>

Missing values

Static members

Static member Description

SeriesExtensions.DropMissing(series)

Full Usage: SeriesExtensions.DropMissing(series)

Parameters:
    series : Series<'K, 'V> - An input series to be filtered

Returns: Series<'K, 'V>
Type parameters: 'K, 'V (requires equality)

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.

series : Series<'K, 'V>

An input series to be filtered

Returns: Series<'K, 'V>
Example

 let s = series [ 1 => 1.0; 2 => Double.NaN ]
 s.DropMissing()
 // val it : Series<int,float> = series [ 1 => 1]
val s: obj

SeriesExtensions.FillMissing(series, filler)

Full Usage: SeriesExtensions.FillMissing(series, filler)

Parameters:
    series : Series<'K, 'T> - An input series that is to be filled
    filler : Func<'K, 'T> - A function that takes key `K` and generates a value to be used in a place where the original series contains a missing value.

Returns: Series<'K, 'T>
Type parameters: 'K, 'T (requires equality)

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.

This function can be used to implement more complex interpolation. For example see [handling missing values in the tutorial](../frame.html#missing)

series : Series<'K, 'T>

An input series that is to be filled

filler : Func<'K, 'T>

A function that takes key `K` and generates a value to be used in a place where the original series contains a missing value.

Returns: Series<'K, 'T>

SeriesExtensions.FillMissing(series, ?direction)

Full Usage: SeriesExtensions.FillMissing(series, ?direction)

Parameters:
    series : Series<'K, 'T> - The input series to be filled
    ?direction : 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.

Returns: Series<'K, 'T>
Type parameters: 'K, 'T (requires equality)

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.

series : Series<'K, 'T>

The input series to be filled

?direction : 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.

Returns: Series<'K, 'T>
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)
val sample: obj

SeriesExtensions.FillMissing(series, value)

Full Usage: SeriesExtensions.FillMissing(series, value)

Parameters:
    series : Series<'K, 'T> - An input series that is to be filled
    value : 'T - A constant value that is used to fill all missing values

Returns: Series<'K, 'T>
Type parameters: 'K, 'T (requires equality)

Fill missing values in the series with a constant value.

series : Series<'K, 'T>

An input series that is to be filled

value : 'T

A constant value that is used to fill all missing values

Returns: Series<'K, 'T>

Series transformations

Static members

Static member Description

SeriesExtensions.ReplaceValue(series, oldValue, newValue)

Full Usage: SeriesExtensions.ReplaceValue(series, oldValue, newValue)

Parameters:
    series : Series<'K, 'T> - An input series
    oldValue : 'T - The value to be replaced
    newValue : 'T - The value to use as replacement

Returns: Series<'K, 'T>
Type parameters: 'K, 'T (requires equality and equality)

Returns a new series where all occurrences of oldValue are replaced with newValue. Missing values in the series are left unchanged.

series : Series<'K, 'T>

An input series

oldValue : 'T

The value to be replaced

newValue : 'T

The value to use as replacement

Returns: Series<'K, 'T>

Type something to start searching.