Header menu logo Deedle

Series Module

The `Series` module provides an F#-friendly API for working with data and time series. The API follows the usual design for collection-processing in F#, so the functions work well with the pipelining (|>) operator. For example, given a series with ages, we can use `Series.filterValues` to filter outliers and then `Stats.mean` to calculate the mean: ages |> Series.filterValues (fun v -> v > 0.0 && v < 120.0) |> Stats.mean The module provides comprehensive set of functions for working with series. The same API is also exposed using C#-friendly extension methods. In C#, the above snippet could be written as: [lang=csharp] ages .Where(kvp => kvp.Value > 0.0 && kvp.Value < 120.0) .Mean() For more information about similar frame-manipulation functions, see the `Frame` module. For more information about C#-friendly extensions, see `SeriesExtensions`. The functions in the `Series` module are grouped in a number of categories and documented below. Accessing series data and lookup -------------------------------- Functions in this category provide access to the values in the series. - The term _observation_ is used for a key value pair in the series. - When working with a sorted series, it is possible to perform lookup using keys that are not present in the series - you can specify to search for the previous or next available value using _lookup behavior_. - Functions such as `get` and `getAll` have their counterparts `lookup` and `lookupAll` that let you specify lookup behavior. - For most of the functions that may fail, there is a `try[Foo]` variant that returns `None` instead of failing. - Functions with a name ending with `At` perform lookup based on the absolute integer offset (and ignore the keys of the series) Series transformations ---------------------- Functions in this category perform standard transformations on series including projections, filtering, taking some sub-series of the series, aggregating values using scanning and so on. Projection and filtering functions generally skip over missing values, but there are variants `filterAll` and `mapAll` that let you handle missing values explicitly. Keys can be transformed using `mapKeys`. When you do not need to consider the keys, and only care about values, use `filterValues` and `mapValues` (which is also aliased as the `$` operator). Series supports standard set of folding functions including `reduce` and `fold` (to reduce series values into a single value) as well as the `scan[All]` function, which can be used to fold values of a series into a series of intermeidate folding results. The functions `take[Last]` and `skip[Last]` can be used to take a sub-series of the original source series by skipping a specified number of elements. Note that this does not require an ordered series and it ignores the index - for index-based lookup use slicing, such as `series.[lo .. hi]`, instead. Finally the `shift` function can be used to obtain a series with values shifted by the specified offset. This can be used e.g. to get previous value for each key using `Series.shift 1 ts`. The `diff` function calculates difference from previous value using `ts - (Series.shift offs ts)`. Processing series with exceptions --------------------------------- The functions in this group can be used to write computations over series that may fail. They use the type tryval<'T> which is defined as a discriminated union with two cases: Success containing a value, or Error containing an exception. The function `tryMap` lets you create Series<'K, tryval<'T>> by mapping over values of an original series. You can then extract values using `tryValues`, which throws `AggregateException` if there were any errors. Functions `tryErrors` and `trySuccesses` give series containing only errors and successes. You can fill failed values with a constant using `fillErrorsWith`. Hierarchical index operations ----------------------------- When the key of a series is tuple, the elements of the tuple can be treated as multiple levels of a index. For example Series<'K1 * 'K2, 'V> has two levels with keys of types 'K1 and 'K2 respectively. The functions in this cateogry provide a way for aggregating values in the series at one of the levels. For example, given a series `input` indexed by two-element tuple, you can calculate mean for different first-level values as follows: input |> applyLevel fst Stats.mean Note that the `Stats` module provides helpers for typical statistical operations, so the above could be written just as `input |> Stats.levelMean fst`. Grouping, windowing and chunking -------------------------------- This category includes functions that group data from a series in some way. Two key concepts here are _window_ and _chunk_. Window refers to (overlapping) sliding windows over the input series while chunk refers to non-overlapping blocks of the series. The boundary behavior can be specified using the `Boundary` flags. The value `Skip` means that boundaries (incomplete windows or chunks) should be skipped. The value `AtBeginning` and `AtEnding` can be used to define at which side should the boundary be returned (or skipped). For chunking, `AtBeginning ||| Skip` makes sense and it means that the incomplete chunk at the beginning should be skipped (aligning the last chunk with the end). The behavior may be specified in a number of ways (which is reflected in the name): - `dist` - using an absolute distance between the keys - `while` - using a condition on the first and last key - `size` - by specifying the absolute size of the window/chunk The functions ending with `Into` take a function to be applied to the window/chunk. The functions `window`, `windowInto` and `chunk`, `chunkInto` are simplified versions that take a size. There is also `pairwise` function for sliding window of size two. Missing values -------------- This group of functions provides a way of working with missing values in a series. The `dropMissing` function drops all keys for which there are no values in the series. The `withMissingFrom` function lets you copy missing values from another series. The remaining functions provide different mechanism for filling the missing values. * `fillMissingWith` fills missing values with a specified constant * `fillMissingUsing` calls a specified function for every missing value * `fillMissing` and variants propagates values from previous/later keys Sorting and index manipulation ------------------------------ A series that is sorted by keys allows a number of additional operations (such as lookup using the `Lookp.ExactOrSmaller` lookup behavior). However, it is also possible to sort series based on the values - although the functions for manipulation with series do not guarantee that the order will be preserved. To sort series by keys, use `sortByKey`. Other sorting functions let you sort the series using a specified comparer function (`sortWith`), using a projection function (`sortBy`) and using the default comparison (`sort`). In addition, you can also replace the keys of a series with other keys using `indexWith` or with integers using `indexOrdinally`. To pick and reorder series values using to match a list of keys use `realign`. Sampling, resampling and advanced lookup ---------------------------------------- Given a (typically) time series sampling or resampling makes it possible to get time series with representative values at lower or uniform frequency. We use the following terminology: - `lookup` and `sample` functions find values at specified key; if a key is not available, they can look for value associated with the nearest smaller or the nearest greater key. - `resample` function aggregate values values into chunks based on a specified collection of keys (e.g. explicitly provided times), or based on some relation between keys (e.g. date times having the same date). - `resampleUniform` is similar to resampling, but we specify keys by providing functions that generate a uniform sequence of keys (e.g. days), the operation also fills value for days that have no corresponding observations in the input sequence. Joining, merging and zipping ---------------------------- Given two series, there are two ways to combine the values. If the keys in the series are not overlapping (or you want to throw away values from one or the other series), then you can use `merge` or `mergeUsing`. To merge more than 2 series efficiently, use the `mergeAll` function, which has been optimized for large number of series. If you want to align two series, you can use the _zipping_ operation. This aligns two series based on their keys and gives you tuples of values. The default behavior (`zip`) uses outer join and exact matching. For ordered series, you can specify other forms of key lookups (e.g. find the greatest smaller key) using `zipAlign`. functions ending with `Into` are generally easier to use as they call a specified function to turn the tuple (of possibly missing values) into a new value. For more complicated behaviors, it is often convenient to use joins on frames instead of working with series. Create two frames with single columns and then use the join operation. The result will be a frame with two columns (which is easier to use than series of tuples).

Table of contents

Other module members

Functions and values

Function or value Description

convert forward backward series

Full Usage: convert forward backward series

Parameters:
    forward : 'T -> 'R - Function that converts original values to the new
    backward : 'R -> 'T - Function that converts new values back to the original
    series : Series<'K, 'T> - The input series

Returns: Series<'K, 'R>

Retruns a new series whose values are converted using the specified conversion function. This operation is like `mapValues`, but it requires a pair of function that converts the values in _both ways_.

This operation is only interesting when working with virtualized data sources. Using the `convert` function makes it possible to perfom additional operations on the resulting series - for example lookup - by converting the new value back and using the lookup of the underlying virtualized source.

forward : 'T -> 'R

Function that converts original values to the new

backward : 'R -> 'T

Function that converts new values back to the original

series : Series<'K, 'T>

The input series

Returns: Series<'K, 'R>

Accessing series data and lookup

Functions and values

Function or value Description

after lowerExclusive series

Full Usage: after lowerExclusive series

Parameters:
    lowerExclusive : 'K - The exclusive lower bound key.
    series : Series<'K, 'T> - The input series.

Returns: Series<'K, 'T>

Returns a new series containing all values with keys strictly greater than lowerExclusive. This is the functional equivalent of series.After(k).

lowerExclusive : 'K

The exclusive lower bound key.

series : Series<'K, 'T>

The input series.

Returns: Series<'K, 'T>

before upperExclusive series

Full Usage: before upperExclusive series

Parameters:
    upperExclusive : 'K - The exclusive upper bound key.
    series : Series<'K, 'T> - The input series.

Returns: Series<'K, 'T>

Returns a new series containing all values with keys strictly less than upperExclusive. This is the functional equivalent of series.Before(k).

upperExclusive : 'K

The exclusive upper bound key.

series : Series<'K, 'T>

The input series.

Returns: Series<'K, 'T>

between lowerInclusive upperInclusive series

Full Usage: between lowerInclusive upperInclusive series

Parameters:
    lowerInclusive : 'K - The inclusive lower bound key.
    upperInclusive : 'K - The inclusive upper bound key.
    series : Series<'K, 'T> - The input series.

Returns: Series<'K, 'T>

Returns a new series containing all values with keys in the range [lowerInclusive, upperInclusive] (both bounds inclusive). This is the functional equivalent of series.Between(lo, hi).

lowerInclusive : 'K

The inclusive lower bound key.

upperInclusive : 'K

The inclusive upper bound key.

series : Series<'K, 'T>

The input series.

Returns: Series<'K, 'T>

countKeys series

Full Usage: countKeys series

Parameters:
Returns: int

Returns the total number of keys in the specified series. This returns the total length of the series, including keys for which there is no value available.

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

countValues series

Full Usage: countValues series

Parameters:
Returns: int

Returns the total number of values in the specified series. This excludes missing values or not available values (such as values created from `null`, `Double.NaN`, or those that are missing due to outer join etc.).

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

endAt upperInclusive series

Full Usage: endAt upperInclusive series

Parameters:
    upperInclusive : 'K - The inclusive upper bound key.
    series : Series<'K, 'T> - The input series.

Returns: Series<'K, 'T>

Returns a new series containing all values with keys less than or equal to upperInclusive. This is the functional equivalent of series.EndAt(k).

upperInclusive : 'K

The inclusive upper bound key.

series : Series<'K, 'T>

The input series.

Returns: Series<'K, 'T>

firstKey series

Full Usage: firstKey series

Parameters:
Returns: 'K

Returns the first key of the series, or throws exception if one doesn't exist

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

firstValue series

Full Usage: firstValue series

Parameters:
Returns: 'V

Returns the first value of the series. This fails if the first value is missing.

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

get key series

Full Usage: get key series

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

Returns: 'T

Get the value for the specified key. Uses exact lookup semantics for key lookup - use `lookup` for more options

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

getAll keys series

Full Usage: getAll keys series

Parameters:
    keys : 'K seq - A sequence of keys that will form the keys of the retunred sequence
    series : Series<'K, 'T> - The input series

Returns: Series<'K, 'T>

Create a new series that contains values for all provided keys. Uses exact lookup semantics for key lookup - use `lookupAll` for more options

keys : 'K seq

A sequence of keys that will form the keys of the retunred sequence

series : Series<'K, 'T>

The input series

Returns: Series<'K, 'T>

getAt index series

Full Usage: getAt index series

Parameters:
    index : int
    series : Series<'K, 'T>

Returns: 'T

Returns the value at the specified (integer) offset.

index : int
series : Series<'K, 'T>
Returns: 'T

has key series

Full Usage: has key series

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

Returns: bool

Returns true when the series contains value for the specified key (This is useful for checking prior to performing a computation)

key : 'K
series : Series<'K, 'T>
Returns: bool

hasAll keys series

Full Usage: hasAll keys series

Parameters:
    keys : 'K seq
    series : Series<'K, 'T>

Returns: bool

Returns true when the series contains value for all of the specified keys (This is useful for checking prior to performing a computation)

keys : 'K seq
series : Series<'K, 'T>
Returns: bool

hasNone keys series

Full Usage: hasNone keys series

Parameters:
    keys : 'K seq
    series : Series<'K, 'T>

Returns: bool

Returns true when the series does not contains value for any of the specified keys (This is useful for checking prior to performing a computation)

keys : 'K seq
series : Series<'K, 'T>
Returns: bool

hasNot key series

Full Usage: hasNot key series

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

Returns: bool

Returns true when the series does not contains value for the specified key (This is useful for checking prior to performing a computation)

key : 'K
series : Series<'K, 'T>
Returns: bool

hasSome keys series

Full Usage: hasSome keys series

Parameters:
    keys : 'K seq
    series : Series<'K, 'T>

Returns: bool

Returns true when the series contains value for some of the specified keys (This is useful for checking prior to performing a computation)

keys : 'K seq
series : Series<'K, 'T>
Returns: bool

keys series

Full Usage: keys series

Parameters:
Returns: 'K seq

Returns the keys of the series as a sequence

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

lastKey series

Full Usage: lastKey series

Parameters:
Returns: 'K

Returns the last key of the series, or throws exception if one doesn't exist

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

lastValue series

Full Usage: lastValue series

Parameters:
Returns: 'V

Returns the last value of the series. This fails if the last value is missing.

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

lookup key lookup series

Full Usage: lookup key lookup series

Parameters:
Returns: 'T

Get the value for the specified key. Use the specified lookup semantics - for exact matching, use `get`

key : 'K
lookup : Lookup
series : Series<'K, 'T>
Returns: 'T

lookupAll keys lookup series

Full Usage: lookupAll keys lookup series

Parameters:
    keys : 'K seq - A sequence of keys that will form the keys of the retunred sequence
    lookup : Lookup - Lookup behavior to use when the value at the specified key does not exist
    series : Series<'K, 'T> - The input series

Returns: Series<'K, 'T>

Create a new series that contains values for all provided keys. Use the specified lookup semantics - for exact matching, use `getAll`

keys : 'K seq

A sequence of keys that will form the keys of the retunred sequence

lookup : Lookup

Lookup behavior to use when the value at the specified key does not exist

series : Series<'K, 'T>

The input series

Returns: Series<'K, 'T>

observations series

Full Usage: observations series

Parameters:
Returns: ('K * 'T) seq

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: ('K * 'T) seq

observationsAll series

Full Usage: observationsAll series

Parameters:
Returns: ('K * 'T option) seq

Returns all keys from the sequence, together with the associated (optional) values.

series : Series<'K, 'T>
Returns: ('K * 'T option) seq

sample keys series

Full Usage: sample keys series

Parameters:
    keys : 'K seq - A sequence of keys that will form the keys of the retunred sequence
    series : Series<'K, 'T> - The input series

Returns: Series<'K, 'T>

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

keys : 'K seq

A sequence of keys that will form the keys of the retunred sequence

series : Series<'K, 'T>

The input series

Returns: Series<'K, 'T>

startAt lowerInclusive series

Full Usage: startAt lowerInclusive series

Parameters:
    lowerInclusive : 'K - The inclusive lower bound key.
    series : Series<'K, 'T> - The input series.

Returns: Series<'K, 'T>

Returns a new series containing all values with keys greater than or equal to lowerInclusive. This is the functional equivalent of series.StartAt(k).

lowerInclusive : 'K

The inclusive lower bound key.

series : Series<'K, 'T>

The input series.

Returns: Series<'K, 'T>

tryFirstValue series

Full Usage: tryFirstValue series

Parameters:
Returns: 'V option

Returns the first value of the series if one exists.

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

tryGet key series

Full Usage: tryGet key series

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

Returns: 'T option

Get the value for the specified key. Returns `None` when the key does not exist or the value is missing. Uses exact lookup semantics for key lookup - use `tryLookup` for more options

key : 'K
series : Series<'K, 'T>
Returns: 'T option

tryGetAt index series

Full Usage: tryGetAt index series

Parameters:
    index : int
    series : Series<'K, 'T>

Returns: 'T option

Returns the value at the specified (integer) offset, or `None` if the value is missing.

index : int
series : Series<'K, 'T>
Returns: 'T option

tryLastValue series

Full Usage: tryLastValue series

Parameters:
Returns: 'V option

Returns the last value of the series if one exists.

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

tryLookup key lookup series

Full Usage: tryLookup key lookup series

Parameters:
Returns: 'T option

Attempts to get the value for the specified key. If the value is not available, `None` is returned. Use the specified lookup semantics - for exact matching, use `tryGet`.

key : 'K
lookup : Lookup
series : Series<'K, 'T>
Returns: 'T option

tryLookupObservation key lookup series

Full Usage: tryLookupObservation key lookup series

Parameters:
Returns: ('K * 'T) option

Attempts to get an observation (key value pair) based on the specified key. The search uses the specified lookup semantics and so the returned key may differ from the key searched for. If the value is not available, `None` is returned.

key : 'K
lookup : Lookup
series : Series<'K, 'T>
Returns: ('K * 'T) option

values series

Full Usage: values series

Parameters:
Returns: 'T seq

Returns the (non-missing) values of the series as a sequence

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

valuesAll series

Full Usage: valuesAll series

Parameters:
Returns: 'T option seq

Returns the series values (both missing and present) as a sequence

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

Creating series

Functions and values

Function or value Description

empty

Full Usage: empty

Returns: Series<'K, 'V> An empty series of type Series<'K, 'V>.

Returns an empty series with no keys or values.

Returns: Series<'K, 'V>

An empty series of type Series<'K, 'V>.

Example

let s : Series = Series.empty

Grouping, windowing and chunking

Functions and values

Function or value Description

aggregate aggregation keySelector series

Full Usage: aggregate aggregation keySelector series

Parameters:
    aggregation : Aggregation<'K> - Specifies the aggregation method using Aggregation<K>. This is a discriminated union listing various chunking and windowing conditions.
    keySelector : DataSegment<Series<'K, 'T>> -> 'TNewKey - A function that is called on each chunk to obtain a key.
    series : Series<'K, 'T> - The input series to be aggregated.

Returns: Series<'TNewKey, DataSegment<Series<'K, 'T>>>

Aggregates an ordered series using the method specified by Aggregation<K> and returns the windows or chunks as nested series. A key for each window or chunk is selected using the specified `keySelector`.

aggregation : Aggregation<'K>

Specifies the aggregation method using Aggregation<K>. This is a discriminated union listing various chunking and windowing conditions.

keySelector : DataSegment<Series<'K, 'T>> -> 'TNewKey

A function that is called on each chunk to obtain a key.

series : Series<'K, 'T>

The input series to be aggregated.

Returns: Series<'TNewKey, DataSegment<Series<'K, 'T>>>

aggregateInto aggregation keySelector f series

Full Usage: aggregateInto aggregation keySelector f series

Parameters:
    aggregation : Aggregation<'K> - Specifies the aggregation method using Aggregation<K>. This is a discriminated union listing various chunking and windowing conditions.
    keySelector : DataSegment<Series<'K, 'T>> -> 'TNewKey - A function that is called on each chunk to obtain a key.
    f : DataSegment<Series<'K, 'T>> -> OptionalValue<'R> - A value selector function that is called to aggregate each chunk or window.
    series : Series<'K, 'T> - The input series to be aggregated.

Returns: Series<'TNewKey, 'R>

Aggregates an ordered series using the method specified by Aggregation<K> and then applies the provided value selector `f` on each window or chunk to produce the result which is returned as a new series. A key for each window or chunk is selected using the specified `keySelector`.

aggregation : Aggregation<'K>

Specifies the aggregation method using Aggregation<K>. This is a discriminated union listing various chunking and windowing conditions.

keySelector : DataSegment<Series<'K, 'T>> -> 'TNewKey

A function that is called on each chunk to obtain a key.

f : DataSegment<Series<'K, 'T>> -> OptionalValue<'R>

A value selector function that is called to aggregate each chunk or window.

series : Series<'K, 'T>

The input series to be aggregated.

Returns: Series<'TNewKey, 'R>

chunk size series

Full Usage: chunk size series

Parameters:
    size : int - The size of the chunk.
    series : Series<'K, 'T> - The input series to be aggregated.

Returns: Series<'K, Series<'K, 'T>>
Modifiers: inline
Type parameters: 'K, 'T

Aggregates the input into a series of adacent chunks and returns the produced chunks as a nested series. The key in the new series is the last key of the chunk. This function skips incomplete chunks - you can use `Series.chunkSize` for more options.

size : int

The size of the chunk.

series : Series<'K, 'T>

The input series to be aggregated.

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

chunkDist distance series

Full Usage: chunkDist distance series

Parameters:
    distance : ^D - The maximal allowed distance between keys of a chunk. Note that this is an inline function - there must be `-` operator defined between `distance` and the keys of the series.
    series : Series<^K, 'T> - The input series to be aggregated.

Returns: Series<^K, Series<^K, 'T>>
Modifiers: inline
Type parameters: ^D, ^K, 'T

Aggregates the input into a series of adacent chunks. A chunk is started once the distance between the first and the last key of a previous chunk is greater than the specified `distance`. The chunks are then returned as a nested series. The key of each chunk is the key of the first element in the chunk.

distance : ^D

The maximal allowed distance between keys of a chunk. Note that this is an inline function - there must be `-` operator defined between `distance` and the keys of the series.

series : Series<^K, 'T>

The input series to be aggregated.

Returns: Series<^K, Series<^K, 'T>>

chunkDistInto distance f series

Full Usage: chunkDistInto distance f series

Parameters:
    distance : ^D - The maximal allowed distance between keys of a chunk. Note that this is an inline function - there must be `-` operator defined between `distance` and the keys of the series.
    f : Series<^K, 'T> -> 'R - A value selector that is called to aggregate each chunk.
    series : Series<^K, 'T> - The input series to be aggregated.

Returns: Series<^K, 'R>
Modifiers: inline
Type parameters: ^D, ^K, 'T, 'R

Aggregates the input into a series of adacent chunks. A chunk is started once the distance between the first and the last key of a previous chunk is greater than the specified `distance`. Each chunk is then aggregated into a value using the specified function `f`. The key of each chunk is the key of the first element in the chunk.

distance : ^D

The maximal allowed distance between keys of a chunk. Note that this is an inline function - there must be `-` operator defined between `distance` and the keys of the series.

f : Series<^K, 'T> -> 'R

A value selector that is called to aggregate each chunk.

series : Series<^K, 'T>

The input series to be aggregated.

Returns: Series<^K, 'R>

chunkInto size f series

Full Usage: chunkInto size f series

Parameters:
    size : int - The size of the chunk.
    f : Series<'K, 'T> -> 'R - A function that is called to aggregate each chunk into a single value.
    series : Series<'K, 'T> - The input series to be aggregated.

Returns: Series<'K, 'R>
Modifiers: inline
Type parameters: 'K, 'T, 'R

Aggregates the input into a series of adacent chunks and then applies the provided value selector `f` on each chunk to produce the result which is returned as a new series. The key in the new series is the last key of the chunk. This function skips incomplete chunks - you can use `Series.chunkSizeInto` for more options.

size : int

The size of the chunk.

f : Series<'K, 'T> -> 'R

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

series : Series<'K, 'T>

The input series to be aggregated.

Returns: Series<'K, 'R>

chunkSize (arg1, arg1) series

Full Usage: chunkSize (arg1, arg1) series

Parameters:
    arg0 : int
    arg1 : Boundary
    series : Series<'K, 'T> - The input series to be aggregated.

Returns: Series<'K, Series<'K, 'T>>
Modifiers: inline
Type parameters: 'K, 'T

Aggregates the input into a series of adacent chunks using the specified size and boundary behavior and returns the produced chunks as a nested series. The key is the first key of the chunk, unless boundary behavior has `Boundary.AtBeginning` flag (in which case it is the last key).

arg0 : int
arg1 : Boundary
series : Series<'K, 'T>

The input series to be aggregated.

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

chunkSizeInto (arg1, arg1) f series

Full Usage: chunkSizeInto (arg1, arg1) f series

Parameters:
    arg0 : int
    arg1 : Boundary
    f : DataSegment<Series<'K, 'T>> -> 'R - A value selector that is called to aggregate each chunk.
    series : Series<'K, 'T> - The input series to be aggregated.

Returns: Series<'K, 'R>
Modifiers: inline
Type parameters: 'K, 'T, 'R

Aggregates the input into a series of adacent chunks using the specified size and boundary behavior and then applies the provided value selector `f` on each chunk to produce the result which is returned as a new series. The key is the first key of the chunk, unless boundary behavior has `Boundary.AtBeginning` flag (in which case it is the last key).

arg0 : int
arg1 : Boundary
f : DataSegment<Series<'K, 'T>> -> 'R

A value selector that is called to aggregate each chunk.

series : Series<'K, 'T>

The input series to be aggregated.

Returns: Series<'K, 'R>

chunkWhile cond series

Full Usage: chunkWhile cond series

Parameters:
    cond : 'K -> 'K -> bool - A function that is called on the first and the last key of a chunk to determine when a window should end.
    series : Series<'K, 'T> - The input series to be aggregated.

Returns: Series<'K, Series<'K, 'T>>
Modifiers: inline
Type parameters: 'K, 'T

Aggregates the input into a series of adacent chunks based on a condition on keys. A chunk is started once the specified `cond` function returns `false` when called on the first and the last key of the previous chunk. The chunks are then returned as a nested series. The key of each chunk is the key of the first element in the chunk.

cond : 'K -> 'K -> bool

A function that is called on the first and the last key of a chunk to determine when a window should end.

series : Series<'K, 'T>

The input series to be aggregated.

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

chunkWhileInto cond f series

Full Usage: chunkWhileInto cond f series

Parameters:
    cond : 'K -> 'K -> bool - A function that is called on the first and the last key of a chunk to determine when a window should end.
    f : Series<'K, 'T> -> 'a - A value selector that is called to aggregate each chunk.
    series : Series<'K, 'T> - The input series to be aggregated.

Returns: Series<'K, 'a>
Modifiers: inline
Type parameters: 'K, 'T, 'a

Aggregates the input into a series of adacent chunks based on a condition on keys. A chunk is started once the specified `cond` function returns `false` when called on the first and the last key of the previous chunk. Each chunk is then aggregated into a value using the specified function `f`. The key of each chunk is the key of the first element in the chunk.

cond : 'K -> 'K -> bool

A function that is called on the first and the last key of a chunk to determine when a window should end.

f : Series<'K, 'T> -> 'a

A value selector that is called to aggregate each chunk.

series : Series<'K, 'T>

The input series to be aggregated.

Returns: Series<'K, 'a>

groupBy keySelector series

Full Usage: groupBy keySelector series

Parameters:
    keySelector : 'K -> 'T -> 'TNewKey - Generates a new key that is used for aggregation, based on the original key and value. The new key must support equality testing.
    series : Series<'K, 'T> - An input series to be grouped.

Returns: Series<'TNewKey, Series<'K, 'T>>

Groups a series (ordered or unordered) using the specified key selector (`keySelector`) and then returns a series of (nested) series as the result. The outer series is indexed by the newly produced keys, the nested series are indexed with the original keys.

keySelector : 'K -> 'T -> 'TNewKey

Generates a new key that is used for aggregation, based on the original key and value. The new key must support equality testing.

series : Series<'K, 'T>

An input series to be grouped.

Returns: Series<'TNewKey, Series<'K, 'T>>

groupInto keySelector f series

Full Usage: groupInto keySelector f series

Parameters:
    keySelector : 'K -> 'T -> 'TNewKey - Generates a new key that is used for aggregation, based on the original key and value. The new key must support equality testing.
    f : 'TNewKey -> Series<'K, 'T> -> 'TNewValue - A function to aggregate each group of collected elements.
    series : Series<'K, 'T> - An input series to be grouped.

Returns: Series<'TNewKey, 'TNewValue>

Groups a series (ordered or unordered) using the specified key selector (`keySelector`) and then aggregates each group into a single value, returned in the resulting series, using the provided `f` function.

keySelector : 'K -> 'T -> 'TNewKey

Generates a new key that is used for aggregation, based on the original key and value. The new key must support equality testing.

f : 'TNewKey -> Series<'K, 'T> -> 'TNewValue

A function to aggregate each group of collected elements.

series : Series<'K, 'T>

An input series to be grouped.

Returns: Series<'TNewKey, 'TNewValue>

pairwise series

Full Usage: pairwise series

Parameters:
    series : Series<'K, 'T> - The input series to be aggregated.

Returns: Series<'K, ('T * 'T)>

Returns a series containing the predecessor and an element for each input, except for the first one. The returned series is one key shorter (it does not contain a value for the first key).

series : Series<'K, 'T>

The input series to be aggregated.

Returns: Series<'K, ('T * 'T)>
Example

 let input = series [ 1 => 'a'; 2 => 'b'; 3 => 'c']
 let res = input |> Series.pairwise
 res = series [2 => ('a', 'b'); 3 => ('b', 'c') ]
val input: obj
val res: obj

pairwiseWith f series

Full Usage: pairwiseWith f series

Parameters:
    f : 'K -> 'T * 'T -> 'a - A function that is called for each pair to produce result in the final series.
    series : Series<'K, 'T> - The input series to be aggregated.

Returns: Series<'K, 'a>

Aggregates the input into pairs containing the predecessor and an element for each input, except for the first one. Then calls the specified aggregation function `f` with a tuple and a key. The returned series is one key shorter (it does not contain a value for the first key).

f : 'K -> 'T * 'T -> 'a

A function that is called for each pair to produce result in the final series.

series : Series<'K, 'T>

The input series to be aggregated.

Returns: Series<'K, 'a>

window size series

Full Usage: window size series

Parameters:
    size : int - The size of the sliding window.
    series : Series<'K, 'T> - The input series to be aggregated.

Returns: Series<'K, Series<'K, 'T>>
Modifiers: inline
Type parameters: 'K, 'T

Creates a sliding window using the specified size and returns the produced windows as a nested series. The key in the new series is the last key of the window. This function skips incomplete chunks - you can use `Series.windowSize` for more options.

size : int

The size of the sliding window.

series : Series<'K, 'T>

The input series to be aggregated.

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

windowDist distance series

Full Usage: windowDist distance series

Parameters:
    distance : 'D - The maximal allowed distance between keys of a window. Note that this is an inline function - there must be `-` operator defined between `distance` and the keys of the series.
    series : Series<^K, 'T> - The input series to be aggregated.

Returns: Series<^K, Series<^K, 'T>>
Modifiers: inline
Type parameters: 'D, ^K, 'T

Creates a sliding window based on distance between keys. A window is started at each input element and ends once the distance between the first and the last key is greater than the specified `distance`. The windows are then returned as a nested series. The key of each window is the key of the first element in the window.

distance : 'D

The maximal allowed distance between keys of a window. Note that this is an inline function - there must be `-` operator defined between `distance` and the keys of the series.

series : Series<^K, 'T>

The input series to be aggregated.

Returns: Series<^K, Series<^K, 'T>>

windowDistInto distance f series

Full Usage: windowDistInto distance f series

Parameters:
    distance : 'a - The maximal allowed distance between keys of a window. Note that this is an inline function - there must be `-` operator defined between `distance` and the keys of the series.
    f : Series<^K, 'T> -> 'b - A function that is used to aggregate each window into a single value.
    series : Series<^K, 'T> - The input series to be aggregated.

Returns: Series<^K, 'b>
Modifiers: inline
Type parameters: 'a, ^K, 'T, 'b

Creates a sliding window based on distance between keys. A window is started at each input element and ends once the distance between the first and the last key is greater than the specified `distance`. Each window is then aggregated into a value using the specified function `f`. The key of each window is the key of the first element in the window.

distance : 'a

The maximal allowed distance between keys of a window. Note that this is an inline function - there must be `-` operator defined between `distance` and the keys of the series.

f : Series<^K, 'T> -> 'b

A function that is used to aggregate each window into a single value.

series : Series<^K, 'T>

The input series to be aggregated.

Returns: Series<^K, 'b>

windowInto size f series

Full Usage: windowInto size f series

Parameters:
    size : int - The size of the sliding window.
    f : Series<'K, 'T> -> 'R - A function that is called on each created window.
    series : Series<'K, 'T> - The input series to be aggregated.

Returns: Series<'K, 'R>
Modifiers: inline
Type parameters: 'K, 'T, 'R

Creates a sliding window using the specified size and then applies the provided value selector `f` on each window to produce the result which is returned as a new series. This function skips incomplete chunks - you can use `Series.windowSizeInto` for more options.

size : int

The size of the sliding window.

f : Series<'K, 'T> -> 'R

A function that is called on each created window.

series : Series<'K, 'T>

The input series to be aggregated.

Returns: Series<'K, 'R>

windowSize (arg1, arg1) series

Full Usage: windowSize (arg1, arg1) series

Parameters:
    arg0 : int
    arg1 : Boundary
    series : Series<'K, 'T> - The input series to be aggregated.

Returns: Series<'K, Series<'K, 'T>>
Modifiers: inline
Type parameters: 'K, 'T

Creates a sliding window using the specified size and boundary behavior and returns the produced windows as a nested series. The key is the last key of the window, unless boundary behavior is `Boundary.AtEnding` (in which case it is the first key).

arg0 : int
arg1 : Boundary
series : Series<'K, 'T>

The input series to be aggregated.

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

windowSizeInto (arg1, arg1) f series

Full Usage: windowSizeInto (arg1, arg1) f series

Parameters:
    arg0 : int
    arg1 : Boundary
    f : DataSegment<Series<'K, 'T>> -> 'R - A value selector that is called to aggregate each window.
    series : Series<'K, 'T> - The input series to be aggregated.

Returns: Series<'K, 'R>

Creates a sliding window using the specified size and boundary behavior and then applies the provided value selector `f` on each window to produce the result which is returned as a new series. The key is the last key of the window, unless boundary behavior is `Boundary.AtEnding` (in which case it is the first key).

arg0 : int
arg1 : Boundary
f : DataSegment<Series<'K, 'T>> -> 'R

A value selector that is called to aggregate each window.

series : Series<'K, 'T>

The input series to be aggregated.

Returns: Series<'K, 'R>

windowWhile cond series

Full Usage: windowWhile cond series

Parameters:
    cond : 'K -> 'K -> bool - A function that is called on the first and the last key of a window to determine when a window should end.
    series : Series<'K, 'T> - The input series to be aggregated.

Returns: Series<'K, Series<'K, 'T>>
Modifiers: inline
Type parameters: 'K, 'T

Creates a sliding window based on a condition on keys. A window is started at each input element and ends once the specified `cond` function returns `false` when called on the first and the last key of the window. The windows are then returned as a nested series. The key of each window is the key of the first element in the window.

cond : 'K -> 'K -> bool

A function that is called on the first and the last key of a window to determine when a window should end.

series : Series<'K, 'T>

The input series to be aggregated.

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

windowWhileInto cond f series

Full Usage: windowWhileInto cond f series

Parameters:
    cond : 'K -> 'K -> bool - A function that is called on the first and the last key of a window to determine when a window should end.
    f : Series<'K, 'T> -> 'a - A function that is used to aggregate each window into a single value.
    series : Series<'K, 'T> - The input series to be aggregated.

Returns: Series<'K, 'a>
Modifiers: inline
Type parameters: 'K, 'T, 'a

Creates a sliding window based on a condition on keys. A window is started at each input element and ends once the specified `cond` function returns `false` when called on the first and the last key of the window. Each window is then aggregated into a value using the specified function `f`. The key of each window is the key of the first element in the window.

cond : 'K -> 'K -> bool

A function that is called on the first and the last key of a window to determine when a window should end.

f : Series<'K, 'T> -> 'a

A function that is used to aggregate each window into a single value.

series : Series<'K, 'T>

The input series to be aggregated.

Returns: Series<'K, 'a>

Hierarchical index operations

Functions and values

Function or value Description

applyLevel level op series

Full Usage: applyLevel level op series

Parameters:
    level : 'K1 -> 'K2 - A delegate that returns a new group key, based on the key in the input series
    op : Series<'K1, 'V> -> 'R - A function that takes a series and produces an aggregated result
    series : Series<'K1, 'V> - An input series to be aggregated

Returns: Series<'K2, 'R>
Modifiers: inline
Type parameters: 'K1, 'K2, 'V, 'R

Groups the elements of the input series in groups based on the keys produced by `level` and then aggregates series representing each group using the specified function `op`. The result is a new series containing the aggregates of each group. This operation is designed to be used with [hierarchical indexing](../frame.html#indexing).

level : 'K1 -> 'K2

A delegate that returns a new group key, based on the key in the input series

op : Series<'K1, 'V> -> 'R

A function that takes a series and produces an aggregated result

series : Series<'K1, 'V>

An input series to be aggregated

Returns: Series<'K2, 'R>

applyLevelOptional level op series

Full Usage: applyLevelOptional level op series

Parameters:
    level : 'K1 -> 'K2 - A delegate that returns a new group key, based on the key in the input series
    op : Series<'K1, 'V> -> 'R option - A function that takes a series and produces an optional aggregated result
    series : Series<'K1, 'V> - An input series to be aggregated

Returns: Series<'K2, 'R>
Modifiers: inline
Type parameters: 'K1, 'K2, 'V, 'R

Groups the elements of the input series in groups based on the keys produced by `level` and then aggregates series representing each group using the specified function `op`. The result is a new series containing the aggregates of each group. The result of a group may be None, in which case the group will have no representation in the resulting series. This operation is designed to be used with [hierarchical indexing](../frame.html#indexing).

level : 'K1 -> 'K2

A delegate that returns a new group key, based on the key in the input series

op : Series<'K1, 'V> -> 'R option

A function that takes a series and produces an optional aggregated result

series : Series<'K1, 'V>

An input series to be aggregated

Returns: Series<'K2, 'R>

reduceLevel level op series

Full Usage: reduceLevel level op series

Parameters:
    level : 'K1 -> 'K2 - A delegate that returns a new group key, based on the key in the input series
    op : 'T -> 'T -> 'T - A function that is used to aggregate elements of each group
    series : Series<'K1, 'T> - An input series to be aggregated

Returns: Series<'K2, 'T>

Groups the elements of the input series in groups based on the keys produced by `level` and then aggregates elements in each group using the specified function `op`. The result is a new series containing the aggregates of each group. This operation is designed to be used with [hierarchical indexing](../frame.html#indexing).

level : 'K1 -> 'K2

A delegate that returns a new group key, based on the key in the input series

op : 'T -> 'T -> 'T

A function that is used to aggregate elements of each group

series : Series<'K1, 'T>

An input series to be aggregated

Returns: Series<'K2, 'T>

Joining, merging and zipping

Functions and values

Function or value Description

compare s1 s2

Full Usage: compare s1 s2

Parameters:
Returns: Series<'K, Diff<'T>>

Compares two series and returns a new series of `Diff`s.

s1 : Series<'K, 'T>
s2 : Series<'K, 'T>
Returns: Series<'K, Diff<'T>>

intersect s1 s2

Full Usage: intersect s1 s2

Parameters:
Returns: Series<'K, 'T>

Returns a new series which is intersection of two series by (key, value) pair.

s1 : Series<'K, 'T>
s2 : Series<'K, 'T>
Returns: Series<'K, 'T>

merge series1 series2

Full Usage: merge series1 series2

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

Merge two series with distinct keys. When the same key with a value occurs in both series, an exception is thrown. In that case, you can use `mergeUsing`, which allows specifying merging behavior.

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

mergeAll series

Full Usage: mergeAll series

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

Merge multiple series with distinct keys. When the same key with a value occurs in two of the series, an exception is thrown. This function is efficient even when the number of series to be merged is large.

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

mergeUsing behavior series1 series2

Full Usage: mergeUsing behavior series1 series2

Parameters:
    behavior : UnionBehavior - specifies how to handle values available in both series. You can use `UnionBehavior.Exclusive` to throw an exception, or `UnionBehavior.PreferLeft` and `UnionBehavior.PreferRight` to prefer values from the first or the second series, respectively.
    series1 : Series<'K, 'V> - the first (left) series to be merged
    series2 : Series<'K, 'V> - the second (right) series to be merged

Returns: Series<'K, 'V>

Merge two series with possibly overlapping keys. The `behavior` parameter specifies how to handle situation when a value is definedin both series.

behavior : UnionBehavior

specifies how to handle values available in both series. You can use `UnionBehavior.Exclusive` to throw an exception, or `UnionBehavior.PreferLeft` and `UnionBehavior.PreferRight` to prefer values from the first or the second series, respectively.

series1 : Series<'K, 'V>

the first (left) series to be merged

series2 : Series<'K, 'V>

the second (right) series to be merged

Returns: Series<'K, 'V>

replace key value series

Full Usage: replace key value series

Parameters:
    key : 'K - A key to be used for replacing of the series
    value : 'V - A value to replace value for `key`
    series : Series<'K, 'V> - The input series

Returns: Series<'K, 'V>

Replace series value given in key with value.

key : 'K

A key to be used for replacing of the series

value : 'V

A value to replace value for `key`

series : Series<'K, 'V>

The input series

Returns: Series<'K, 'V>

replaceArray keys value series

Full Usage: replaceArray keys value series

Parameters:
    keys : 'K[] - An array of keys to be used for replacing of the series
    value : 'V - A value to replace any values for `keys`
    series : Series<'K, 'V> - The input series

Returns: Series<'K, 'V>

Replace series values given in keys with value.

keys : 'K[]

An array of keys to be used for replacing of the series

value : 'V

A value to replace any values for `keys`

series : Series<'K, 'V>

The input series

Returns: Series<'K, 'V>

zip series1 series2

Full Usage: zip series1 series2

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

Align and zip two series using outer join and exact key matching. The function returns a series of tuples where both elements may be missing. As a result, it is often easier to use join on frames instead.

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

zipAlign kind lookup series1 series2

Full Usage: zipAlign kind lookup series1 series2

Parameters:
    kind : JoinKind - specifies the kind of join you want to use (left, right, inner or outer). For inner join, it is better to use `zipInner` instead.
    lookup : Lookup - specifies how matching keys are found when left or right join is used on a sorted series. Use this to find the nearest smaller or nearest greater key in the other series. Supported values are `Lookup.Exact`, `Lookup.ExactOrSmaller` and `Lookup.ExactOrGreater`.
    series1 : Series<'K, 'V1> - The first (left) series to be aligned
    series2 : Series<'K, 'V2> - The second (right) series to be aligned

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

Align and zip two series using the specified joining mechanism and key matching. The function returns a series of tuples where both elements may be missing. As a result, it is often easier to use join on frames instead.

kind : JoinKind

specifies the kind of join you want to use (left, right, inner or outer). For inner join, it is better to use `zipInner` instead.

lookup : Lookup

specifies how matching keys are found when left or right join is used on a sorted series. Use this to find the nearest smaller or nearest greater key in the other series. Supported values are `Lookup.Exact`, `Lookup.ExactOrSmaller` and `Lookup.ExactOrGreater`.

series1 : Series<'K, 'V1>

The first (left) series to be aligned

series2 : Series<'K, 'V2>

The second (right) series to be aligned

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

zipAlignInto kind lookup op series1 series2

Full Usage: zipAlignInto kind lookup op series1 series2

Parameters:
    kind : JoinKind - specifies the kind of join you want to use (left, right, inner or outer). For inner join, it is better to use `zipInner` instead.
    lookup : Lookup - specifies how matching keys are found when left or right join is used on a sorted series. Use this to find the nearest smaller or nearest greater key in the other series. Supported values are `Lookup.Exact`, `Lookup.ExactOrSmaller` and `Lookup.ExactOrGreater`.
    op : 'V1 option -> 'V2 option -> 'R option - A function that combines values from the two series. In case of left, right or outer join, some of the values may be missing. The function can also return `None` to indicate a missing result.
    series1 : Series<'K, 'V1> - The first (left) series to be aligned
    series2 : Series<'K, 'V2> - The second (right) series to be aligned

Returns: Series<'K, 'R>

Align and zip two series using the specified joining mechanism and key matching. The function calls the specified function `op` to combine values from the two series

kind : JoinKind

specifies the kind of join you want to use (left, right, inner or outer). For inner join, it is better to use `zipInner` instead.

lookup : Lookup

specifies how matching keys are found when left or right join is used on a sorted series. Use this to find the nearest smaller or nearest greater key in the other series. Supported values are `Lookup.Exact`, `Lookup.ExactOrSmaller` and `Lookup.ExactOrGreater`.

op : 'V1 option -> 'V2 option -> 'R option

A function that combines values from the two series. In case of left, right or outer join, some of the values may be missing. The function can also return `None` to indicate a missing result.

series1 : Series<'K, 'V1>

The first (left) series to be aligned

series2 : Series<'K, 'V2>

The second (right) series to be aligned

Returns: Series<'K, 'R>

zipInner series1 series2

Full Usage: zipInner series1 series2

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

Align and zip two series using inner join and exact key matching. The function returns a series of tuples with values from the two series.

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

zipInto op series1 series2

Full Usage: zipInto op series1 series2

Parameters:
    op : 'V1 -> 'V2 -> 'R - A function that combines values from the two series.
    series1 : Series<'K, 'V1> - The first (left) series to be aligned
    series2 : Series<'K, 'V2> - The second (right) series to be aligned

Returns: Series<'K, 'R>

Align and zip two series using inner join and exact key matching (use `zipAlignInto` for more options). The function calls the specified function `op` to combine values from the two series

op : 'V1 -> 'V2 -> 'R

A function that combines values from the two series.

series1 : Series<'K, 'V1>

The first (left) series to be aligned

series2 : Series<'K, 'V2>

The second (right) series to be aligned

Returns: Series<'K, 'R>

Missing values

Functions and values

Function or value Description

dropMissing series

Full Usage: dropMissing series

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

Returns: Series<'K, 'T>

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, 'T>

An input series to be filtered

Returns: Series<'K, 'T>
Example

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

fillMissing direction series

Full Usage: fillMissing direction series

Parameters:
    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.
    series : Series<'K, 'T> - An input series that is to be filled

Returns: Series<'K, 'T>

Fill missing values in the series with the nearest available value (using the specified direction). Note that the series may still contain missing values after call to this function. This operation can only be used on ordered series.

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.

series : Series<'K, 'T>

An input series that is to be filled

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 |> Series.fillMissing Direction.Backward

 // Returns a series consisting of [<missing>; 1; 1; 3]
 sample |> Series.fillMissing Direction.Forward
val sample: obj

fillMissingBetween (startKey, endKey) direction series

Full Usage: fillMissingBetween (startKey, endKey) direction series

Parameters:
    startKey : 'K - the lower bound at which values should be filled
    endKey : 'K - the upper bound at which values should 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.
    series : Series<'K, 'T> - An input series that is to be filled

Returns: Series<'K, 'T>

Fill missing values only between `startKey` and `endKey`, inclusive.

startKey : 'K

the lower bound at which values should be filled

endKey : 'K

the upper bound at which values should 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.

series : Series<'K, 'T>

An input series that is to be filled

Returns: Series<'K, 'T>

fillMissingInside direction series

Full Usage: fillMissingInside direction series

Parameters:
Returns: Series<'K, 'T>

Fill missing values only between the first and last non-missing values.

direction : Direction
series : Series<'K, 'T>
Returns: Series<'K, 'T>

fillMissingUsing f series

Full Usage: fillMissingUsing f series

Parameters:
    f : '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.
    series : Series<'K, 'T> - An input series that is to be filled

Returns: Series<'K, '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.

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

f : '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.

series : Series<'K, 'T>

An input series that is to be filled

Returns: Series<'K, 'T>

fillMissingWith value series

Full Usage: fillMissingWith value series

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

Returns: Series<'K, 'T>

Fill missing values in the series with a constant value.

value : 'a

A constant value that is used to fill all missing values

series : Series<'K, 'T>

An input series that is to be filled

Returns: Series<'K, 'T>

withMissingFrom other series

Full Usage: withMissingFrom other series

Parameters:
Returns: Series<'K, 'T>

Returns the current series with the same index but with values missing wherever the corresponding key exists in the other series index with an associated missing value.

other : Series<'K, 'S>
series : Series<'K, 'T>
Returns: Series<'K, 'T>

Processing series with exceptions

Functions and values

Function or value Description

fillErrorsWith value series

Full Usage: fillErrorsWith value series

Parameters:
Returns: Series<'K, 'T>

Givnen a series of tryval<'V> values, returns a new series where all `Error` values are filled with the specified constant value.

value : 'T
series : Series<'K, 'T tryval>
Returns: Series<'K, 'T>

tryErrors series

Full Usage: tryErrors series

Parameters:
Returns: Series<'K, exn>

Given a series of tryval<'V> values, returns a series that contains all exceptions contained in the source series. The exceptions are returned as a series.

series : Series<'K, 'V tryval>
Returns: Series<'K, exn>

tryMap f series

Full Usage: tryMap f series

Parameters:
    f : 'K -> 'T -> 'R
    series : Series<'K, 'T>

Returns: Series<'K, 'R tryval>

Returns a new series by applying the specified transformation to all values of the input series. The result contains `Error(e)` when the projection fails with an exception `e` or `Success(v)` containing a value `v` otherwise.

f : 'K -> 'T -> 'R
series : Series<'K, 'T>
Returns: Series<'K, 'R tryval>

trySuccesses series

Full Usage: trySuccesses series

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

Given a series of tryval<'V> values, returns a series that contains all values contained in the source series. The input elements containing exceptions are ignored.

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

tryValues series

Full Usage: tryValues series

Parameters:
Returns: Series<'K, 'T>

Obtains values from a series of tryval<'T> values. When the series contains one or more failures, the operation throws `AggregateException`. Otherwise, it returns a series containing values.

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

Sampling, resampling and advanced lookup

Functions and values

Function or value Description

lookupTime interval dir lookup series

Full Usage: lookupTime interval dir lookup series

Parameters:
    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.
    lookup : 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)
    series : Series<^K, ^V> - An input series to be resampled

Returns: Series<^K, ^V>
Modifiers: inline
Type parameters: ^K, ^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 values close to such keys using the specified `lookup` and `dir`.

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

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.

lookup : 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)

series : Series<^K, ^V>

An input series to be resampled

Returns: Series<^K, ^V>

lookupTimeAt start interval dir lookup series

Full Usage: lookupTimeAt start interval dir lookup series

Parameters:
    start : ^K - The initial time to be used for sampling
    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.
    lookup : 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)
    series : Series<^K, ^V> - An input series to be resampled

Returns: Series<^K, ^V>
Modifiers: inline
Type parameters: ^K, ^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 values close to such keys using the specified `lookup` and `dir`.

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

start : ^K

The initial time to be used for sampling

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.

lookup : 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)

series : Series<^K, ^V>

An input series to be resampled

Returns: Series<^K, ^V>

resample keys dir series

Full Usage: resample keys dir series

Parameters:
    keys : 'K seq - A collection of keys to be used for resampling of the series
    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.
    series : Series<'K, 'V> - An input series to be resampled

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

Resample the series based on a provided collection of keys. The values of the series are aggregated into chunks based on the specified keys. Depending on `direction`, the specified key is either used as the smallest or as the greatest key of the chunk (with the exception of boundaries that are added to the first/last chunk). Such 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.

keys : 'K seq

A collection of keys to be used for resampling of the series

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.

series : Series<'K, 'V>

An input series to be resampled

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

resampleEquiv keyProj series

Full Usage: resampleEquiv keyProj series

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

Returns: Series<'K2, Series<'K1, 'V1>>
Modifiers: inline
Type parameters: 'K1, 'K2, 'V1

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 function is similar to `Series.chunkBy`, with the exception that it transforms keys to a new space. 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 `Series.groupBy`.

keyProj : 'K1 -> 'K2

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

series : Series<'K1, 'V1>

An input series to be resampled

Returns: Series<'K2, Series<'K1, 'V1>>

resampleEquivInto keyProj f series

Full Usage: resampleEquivInto keyProj f series

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

Returns: Series<'K2, 'V2>
Modifiers: inline
Type parameters: 'K1, 'K2, 'V1, 'V2

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 function is similar to `Series.chunkBy`, with the exception that it transforms keys to a new space. 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 `Series.groupBy`.

keyProj : 'K1 -> 'K2

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

f : Series<'K1, 'V1> -> 'V2

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

series : Series<'K1, 'V1>

An input series to be resampled

Returns: Series<'K2, 'V2>

resampleInto keys dir f series

Full Usage: resampleInto keys dir f series

Parameters:
    keys : 'K seq - A collection of keys to be used for resampling of the series
    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.
    f : 'K -> Series<'K, 'V> -> 'a - A function that is used to collapse a generated chunk into a single value. Note that this function may be called with empty series.
    series : Series<'K, 'V> - An input series to be resampled

Returns: Series<'K, 'a>

Resample the series based on a provided collection of keys. The values of the series are aggregated into chunks based on the specified keys. Depending on `direction`, the specified key is either used as the smallest or as the greatest key of the chunk (with the exception of boundaries that are added to the first/last chunk). Such chunks are then aggregated using the provided function `f`.

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

keys : 'K seq

A collection of keys to be used for resampling of the series

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.

f : 'K -> Series<'K, 'V> -> 'a

A function that is used to collapse a generated chunk into a single value. Note that this function may be called with empty series.

series : Series<'K, 'V>

An input series to be resampled

Returns: Series<'K, 'a>

resampleUniform fillMode keyProj nextKey series

Full Usage: resampleUniform fillMode keyProj nextKey series

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

Returns: Series<'K2, Series<'K1, 'V>>

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. Then return the chunks as nested series. When there are no values for a (generated) key, then the function behaves according to `fillMode`. It can look at the greatest value of previous chunk or smallest value of the next chunk, or it produces an empty series.

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

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.

keyProj : 'K1 -> 'K2

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

nextKey : 'K2 -> 'K2

A function that gets the next key in the transformed space

series : Series<'K1, 'V>

An input series to be resampled

Returns: Series<'K2, Series<'K1, 'V>>

resampleUniformInto fillMode keyProj nextKey f series

Full Usage: resampleUniformInto fillMode keyProj nextKey f series

Parameters:
    fillMode : Lookup - When set to `Lookup.ExactOrSmaller` or `Lookup.ExactOrGreater`, 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. Values `Lookup.Smaller` and `Lookup.Greater` are not supported.
    keyProj : 'K1 -> 'K2 - A function that transforms keys from original space to a new space (which is then used for grouping based on equivalence)
    nextKey : 'K2 -> 'K2 - A function that gets the next key in the transformed space
    f : Series<'K1, 'V> -> 'a - A function that is used to collapse a generated chunk into a single value. The function may be called on empty series when `fillMode` is `Lookup.Exact`.
    series : Series<'K1, 'V> - An input series to be resampled

Returns: Series<'K2, '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). A specified function `keyProj` is used to project keys to another space and `nextKey` is used to generate all keys in the range. The chunk is then aggregated using `f`. When there are no values for a (generated) key, then the function behaves according to `fillMode`. It can look at the greatest value of previous chunk or smallest value of the next chunk, or it produces an empty series.

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

fillMode : Lookup

When set to `Lookup.ExactOrSmaller` or `Lookup.ExactOrGreater`, 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. Values `Lookup.Smaller` and `Lookup.Greater` are not supported.

keyProj : 'K1 -> 'K2

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

nextKey : 'K2 -> 'K2

A function that gets the next key in the transformed space

f : Series<'K1, 'V> -> 'a

A function that is used to collapse a generated chunk into a single value. The function may be called on empty series when `fillMode` is `Lookup.Exact`.

series : Series<'K1, 'V>

An input series to be resampled

Returns: Series<'K2, 'a>

sampleTime interval dir series

Full Usage: sampleTime interval dir series

Parameters:
    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.
    series : Series<^a, 'b> - An input series to be resampled

Returns: Series<^a, Series<^a, 'b>>
Modifiers: inline
Type parameters: ^a, 'b

Performs sampling by time and returns chunks obtained by time-sampling as a nested series. 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.

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.

series : Series<^a, 'b>

An input series to be resampled

Returns: Series<^a, Series<^a, 'b>>

sampleTimeAt start interval dir series

Full Usage: sampleTimeAt start interval dir series

Parameters:
    start : ^a - The initial time to be used for sampling
    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.
    series : Series<^a, 'b> - An input series to be resampled

Returns: Series<^a, Series<^a, 'b>>
Modifiers: inline
Type parameters: ^a, 'b

Performs sampling by time and returns chunks obtained by time-sampling as a nested series. The operation generates keys starting at the given `start` time, 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.

start : ^a

The initial time to be used for sampling

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.

series : Series<^a, 'b>

An input series to be resampled

Returns: Series<^a, Series<^a, 'b>>

sampleTimeAtInto start interval dir f series

Full Usage: sampleTimeAtInto start interval dir f series

Parameters:
    start : ^K - The initial time to be used for sampling
    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.
    f : Series<^K, ^V> -> 'a - A function that is called to aggregate each chunk into a single value.
    series : Series<^K, ^V> - An input series to be resampled

Returns: Series<^K, 'a>
Modifiers: inline
Type parameters: ^K, ^V, 'a

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 given `start` time, 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.

start : ^K

The initial time to be used for sampling

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.

f : Series<^K, ^V> -> 'a

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

series : Series<^K, ^V>

An input series to be resampled

Returns: Series<^K, 'a>

sampleTimeInto interval dir f series

Full Usage: sampleTimeInto interval dir f series

Parameters:
    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.
    f : Series<^K, ^V> -> 'a - A function that is called to aggregate each chunk into a single value.
    series : Series<^K, ^V> - An input series to be resampled

Returns: Series<^K, 'a>
Modifiers: inline
Type parameters: ^K, ^V, 'a

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.

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.

f : Series<^K, ^V> -> 'a

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

series : Series<^K, ^V>

An input series to be resampled

Returns: Series<^K, 'a>

Series transformations

Functions and values

Function or value Description

diff offset series

Full Usage: diff offset series

Parameters:
    offset : int - When positive, subtracts the past values from the current values; when negative, subtracts the future values from the current values.
    series : Series<'K, ^T> - The input series, containing values that support the `-` operator.

Returns: Series<'K, ^T>
Modifiers: inline
Type parameters: 'K, ^T

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. In pseudo-code, the function behaves as follows: result[k] = series[k] - series[k - offset]

offset : int

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

series : Series<'K, ^T>

The input series, containing values that support the `-` operator.

Returns: Series<'K, ^T>

diffDate offset series

Full Usage: diffDate offset series

Parameters:
Returns: Series<'K, TimeSpan>
 Returns a series containing the difference (as TimeSpan) between a
 DateTime value in the original series and a DateTime value at the
 specified offset. For example, calling Series.diffDate 1 s returns a series
 where the previous timestamp is subtracted from the current one. In pseudo-code:

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

 Note: Unlike Series.diff for numeric types, this function handles the
 heterogeneous subtraction (DateTime - DateTime = TimeSpan) by using shift
 and zipInto internally.

 ## 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 of DateTime values.

 [category:Series transformations]
offset : int
series : Series<'K, DateTime>
Returns: Series<'K, TimeSpan>

diffDateOffset offset series

Full Usage: diffDateOffset offset series

Parameters:
Returns: Series<'K, TimeSpan>
 Returns a series containing the difference (as TimeSpan) between a
 DateTimeOffset value in the original series and a DateTimeOffset value
 at the specified offset. For example, calling Series.diffDateOffset 1 s returns
 a series where the previous timestamp is subtracted from the current one. In pseudo-code:

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

 Note: Unlike Series.diff for numeric types, this function handles the
 heterogeneous subtraction (DateTimeOffset - DateTimeOffset = TimeSpan) by using
 shift and zipInto internally.

 ## 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 of DateTimeOffset values.

 [category:Series transformations]
offset : int
series : Series<'K, DateTimeOffset>
Returns: Series<'K, TimeSpan>

filter f series

Full Usage: filter f series

Parameters:
    f : 'K -> 'T -> bool
    series : Series<'K, 'T>

Returns: Series<'K, 'T>

Returns a new series containing only the elements for which the specified predicate returns `true`. The function skips over missing values. If you want to handle missing values, use `filterAll` instead.

f : 'K -> 'T -> bool
series : Series<'K, 'T>
Returns: Series<'K, 'T>

filterAll f series

Full Usage: filterAll f series

Parameters:
    f : 'K -> 'T option -> bool
    series : Series<'K, 'T>

Returns: Series<'K, 'T>

Returns a new series containing only the elements for which the specified predicate returns `true`. The predicate is called for missing values as well.

f : 'K -> 'T option -> bool
series : Series<'K, 'T>
Returns: Series<'K, 'T>

filterByMask mask series

Full Usage: filterByMask mask series

Parameters:
    mask : Series<'K, bool> - A series of boolean values indexed by the same key type
    series : Series<'K, 'T> - The input series to filter

Returns: Series<'K, 'T>

Returns a new series containing only the elements of the input series whose key maps to true in the given boolean mask series. Keys that are missing from the mask are excluded. This enables pandas-style boolean indexing.

mask : Series<'K, bool>

A series of boolean values indexed by the same key type

series : Series<'K, 'T>

The input series to filter

Returns: Series<'K, 'T>

filterValues f series

Full Usage: filterValues f series

Parameters:
    f : 'T -> bool
    series : Series<'K, 'T>

Returns: Series<'K, 'T>

Returns a new series containing only the elements for which the specified predicate returns `true`. The function skips over missing values and calls the predicate with just the value. See also `filterAll` and `filter` for more options.

f : 'T -> bool
series : Series<'K, 'T>
Returns: Series<'K, 'T>

flatten series

Full Usage: flatten series

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

Returns: Series<'K, 'T>

Given a series containing optional values, flatten the option values. That is, `None` values become missing values of the series and `Some` values become ordinary values in the resulting series.

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

foldValues op init series

Full Usage: foldValues op init series

Parameters:
    op : 'a -> 'T -> 'a - A function that is used to aggregate elements of the series with the current state
    init : 'a - An initial value for the aggregation
    series : Series<'K, 'T> - An input series to be aggregated

Returns: 'a

Aggregates the values of the specified series using a function that can combine individual values. The folding starts with the specified initial value.

op : 'a -> 'T -> 'a

A function that is used to aggregate elements of the series with the current state

init : 'a

An initial value for the aggregation

series : Series<'K, 'T>

An input series to be aggregated

Returns: 'a

force series

Full Usage: force series

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

Returns a new fully evaluated series. If the source series contains a lazy index or lazy vectors, these are forced to evaluate and the resulting series is fully loaded in memory.

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

map f series

Full Usage: map f series

Parameters:
    f : 'K -> 'T -> 'R
    series : Series<'K, 'T>

Returns: Series<'K, 'R>

Returns a new series whose values are the results of applying the given function to values of the original series. This function skips over missing values and call the function with both keys and values.

f : 'K -> 'T -> 'R
series : Series<'K, 'T>
Returns: Series<'K, 'R>

mapAll f series

Full Usage: mapAll f series

Parameters:
    f : 'K -> 'T option -> 'R option
    series : Series<'K, 'T>

Returns: Series<'K, 'R>

Returns a new series whose values are the results of applying the given function to values of the original series. This specified function is called even when the value is missing. It returns option<'T> so that it can create/eliminate missing values in the result.

f : 'K -> 'T option -> 'R option
series : Series<'K, 'T>
Returns: Series<'K, 'R>

mapKeys f series

Full Usage: mapKeys f series

Parameters:
    f : 'K -> 'R
    series : Series<'K, 'T>

Returns: Series<'R, 'T>

Returns a new series whose keys are the results of applying the given function to keys of the original series.

f : 'K -> 'R
series : Series<'K, 'T>
Returns: Series<'R, 'T>

mapValues f series

Full Usage: mapValues f series

Parameters:
    f : 'T -> 'R
    series : Series<'K, 'T>

Returns: Series<'K, 'R>

Returns a new series whose values are the results of applying the given function to values of the original series. This function skips over missing values and call the function with just values. It is also aliased using the `$` operator so you can write `series $ func` for `series |> Series.mapValues func`.

f : 'T -> 'R
series : Series<'K, 'T>
Returns: Series<'K, 'R>

maskAll f series

Full Usage: maskAll f series

Parameters:
    f : 'K -> 'T option -> bool
    series : Series<'K, 'T>

Returns: Series<'K, 'T>

Returns a new series with values replaced by missing where the predicate returns `true`. The predicate is called with both the key and an optional value (to handle missing values). This is the complement of `filterAll`: instead of dropping matching entries the values are replaced with missing so that the key alignment of the series is preserved.

f : 'K -> 'T option -> bool
series : Series<'K, 'T>
Returns: Series<'K, 'T>

maskValues f series

Full Usage: maskValues f series

Parameters:
    f : 'T -> bool
    series : Series<'K, 'T>

Returns: Series<'K, 'T>

Returns a new series with values replaced by missing where the predicate returns `true`. The predicate is called with the value only; missing values are never masked by this function.

f : 'T -> bool
series : Series<'K, 'T>
Returns: Series<'K, 'T>

pctChange offset series

Full Usage: pctChange offset series

Parameters:
    offset : int - When positive, computes change from past values; when negative, computes change relative to future values.
    series : Series<'K, ^T> - The input series, containing values that support the - and / operators.

Returns: Series<'K, ^T>
Modifiers: inline
Type parameters: 'K, ^T, ^a

Returns a series containing the percentage change between a value in the series and a value at the specified offset. For example, calling Series.pctChange 1 s returns a series where each value is the relative change from the previous value. In pseudo-code: result[k] = (series[k] - series[k - offset]) / series[k - offset] This is commonly used in financial analysis to compute returns.

offset : int

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

series : Series<'K, ^T>

The input series, containing values that support the - and / operators.

Returns: Series<'K, ^T>

reduceValues op series

Full Usage: reduceValues op series

Parameters:
    op : 'T -> 'T -> 'T - A function that is used to aggregate elements of the series
    series : Series<'K, 'T> - An input series to be aggregated

Returns: 'T

Aggregates the values of the specified series using a function that can combine individual values. Fails if the series contains no values.

op : 'T -> 'T -> 'T

A function that is used to aggregate elements of the series

series : Series<'K, 'T>

An input series to be aggregated

Returns: 'T

scanAllValues foldFunc init series

Full Usage: scanAllValues foldFunc init series

Parameters:
    foldFunc : 'R option -> 'T option -> 'R option - A folding function
    init : 'R option - An initial value
    series : Series<'K, 'T> - The series over whose values to scan

Returns: Series<'K, 'R>

Applies a folding function starting with some initial optional value and the first optional value of the series, and continues to "scan" along the series, saving all values produced from the first function application, and yielding a new series having the original index and newly produced values.

foldFunc : 'R option -> 'T option -> 'R option

A folding function

init : 'R option

An initial value

series : Series<'K, 'T>

The series over whose values to scan

Returns: Series<'K, 'R>

scanValues foldFunc init series

Full Usage: scanValues foldFunc init series

Parameters:
    foldFunc : 'R -> 'T -> 'R - A folding function
    init : 'R - An initial value
    series : Series<'K, 'T> - The series over whose values to scan

Returns: Series<'K, 'R>

Applies a folding function starting with some initial value and the first value of the series, and continues to "scan" along the series, saving all values produced from the first function application, and yielding a new series having the original index and newly produced values. Any application involving a missing value yields a missing value.

foldFunc : 'R -> 'T -> 'R

A folding function

init : 'R

An initial value

series : Series<'K, 'T>

The series over whose values to scan

Returns: Series<'K, 'R>

shift offset series

Full Usage: shift offset series

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

Returns: Series<'K, 'T>

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.

offset : int

Can be both positive and negative number.

series : Series<'K, 'T>

The input series to be shifted.

Returns: Series<'K, 'T>

skip count series

Full Usage: skip count series

Parameters:
    count : int - Number of keys to skip; must be smaller or equal to the original number of keys
    series : Series<'K, 'T> - Input series from which the keys are taken

Returns: Series<'K, 'T>

Returns a series that contains the data from the original series, except for the first `count` keys.

count : int

Number of keys to skip; must be smaller or equal to the original number of keys

series : Series<'K, 'T>

Input series from which the keys are taken

Returns: Series<'K, 'T>

skipLast count series

Full Usage: skipLast count series

Parameters:
    count : int - Number of keys to skip; must be smaller or equal to the original number of keys
    series : Series<'K, 'T> - Input series from which the keys are taken

Returns: Series<'K, 'T>

Returns a series that contains the data from the original series, except for the last `count` keys.

count : int

Number of keys to skip; must be smaller or equal to the original number of keys

series : Series<'K, 'T>

Input series from which the keys are taken

Returns: Series<'K, 'T>

take count series

Full Usage: take count series

Parameters:
    count : int - Number of keys to take; must be smaller or equal to the original number of keys
    series : Series<'K, 'T> - Input series from which the keys are taken

Returns: Series<'K, 'T>

Returns a series that contains the specified number of keys from the original series.

count : int

Number of keys to take; must be smaller or equal to the original number of keys

series : Series<'K, 'T>

Input series from which the keys are taken

Returns: Series<'K, 'T>

takeLast count series

Full Usage: takeLast count series

Parameters:
    count : int - Number of keys to take; must be smaller or equal to the original number of keys
    series : Series<'K, 'T> - Input series from which the keys are taken

Returns: Series<'K, 'T>

Returns a series that contains the specified number of keys from the original series. The keys are taken from the end of the series.

count : int

Number of keys to take; must be smaller or equal to the original number of keys

series : Series<'K, 'T>

Input series from which the keys are taken

Returns: Series<'K, 'T>

Sorting and index manipulation

Functions and values

Function or value Description

indexOrdinally series

Full Usage: indexOrdinally series

Parameters:
Returns: Series<int, 'T>

Return a new series containing the same values as the original series, but with ordinal index formed by `int` values starting from 0.

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

indexWith keys series

Full Usage: indexWith keys series

Parameters:
    keys : 'K2 seq
    series : Series<'K1, 'T>

Returns: Series<'K2, 'T>

Returns a new series containing the specified keys mapped to the original values of the series. When the sequence contains _fewer_ keys, the values from the series are dropped. When it contains _more_ keys, the values for additional keys are missing.

keys : 'K2 seq
series : Series<'K1, 'T>
Returns: Series<'K2, 'T>

realign keys series

Full Usage: realign keys series

Parameters:
    keys : 'K seq
    series : Series<'K, 'T>

Returns: Series<'K, 'T>

Given an original series and a sequence of keys, returns a new series that contains the matching value for each of the specified keys. The `KeyCount` of the returned sequence is the length of `keys`. If there is no value for the specified keys in the input sequence, the returned series will contain a missing value.

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

rev series

Full Usage: rev series

Parameters:
Returns: Series<'K, 'T>

Returns a new series, containing the observations of the original series in a reverse order.

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

sort series

Full Usage: sort series

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

Returns a new series, containing the observations of the original series sorted based on the default ordering defined on the values of the series.

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

sortBy proj series

Full Usage: sortBy proj series

Parameters:
    proj : 'T -> 'V - A projection function that returns a value to be compared for each value contained in the original input series.
    series : Series<'K, 'T> - An input series whose values are sorter

Returns: Series<'K, 'T>

Returns a new series, containing the observations of the original series sorted by values returned by the specified projection function.

proj : 'T -> 'V

A projection function that returns a value to be compared for each value contained in the original input series.

series : Series<'K, 'T>

An input series whose values are sorter

Returns: Series<'K, 'T>

sortByKey series

Full Usage: sortByKey series

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

Returns: Series<'K, 'T>

Returns a new series whose observations are sorted according to keys of the index.

series : Series<'K, 'T>

An input series to be sorted

Returns: Series<'K, 'T>

sortWith comparer series

Full Usage: sortWith comparer series

Parameters:
    comparer : 'V -> 'V -> int - A comparer function on the series values. The function should return negative integer when the first value is smaller, positive when it is greater and 0 when the values are equal.
    series : Series<'K, 'V> - An input series whose values are sorter

Returns: Series<'K, 'V>

Returns a new series, containing the observations of the original series sorted using the specified comparison function.

comparer : 'V -> 'V -> int

A comparer function on the series values. The function should return negative integer when the first value is smaller, positive when it is greater and 0 when the values are equal.

series : Series<'K, 'V>

An input series whose values are sorter

Returns: Series<'K, 'V>

Type something to start searching.