SeriesModule Class |
Namespace: Deedle
public static class SeriesModule
The SeriesModule type exposes the following members.
Name | Description | |
---|---|---|
AggregateK, T, TNewKey |
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`.
## Parameters
- `aggregation` - Specifies the aggregation method using `Aggregation<K>`. This is
a discriminated union listing various chunking and windowing conditions.
- `keySelector` - A function that is called on each chunk to obtain a key.
- `series` - The input series to be aggregated.
[category:Grouping, windowing and chunking]
| |
AggregateIntoK, T, 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`.
## Parameters
- `aggregation` - Specifies the aggregation method using `Aggregation<K>`. This is
a discriminated union listing various chunking and windowing conditions.
- `keySelector` - A function that is called on each chunk to obtain a key.
- `f` - A value selector function that is called to aggregate each chunk or window.
- `series` - The input series to be aggregated.
[category:Grouping, windowing and chunking]
| |
ApplyLevelK1, 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).
## Parameters
- `series` - An input series to be aggregated
- `op` - A function that takes a series and produces an aggregated result
- `level` - A delegate that returns a new group key, based on the key in the input series
[category:Hierarchical index operations]
| |
ApplyLevelOptionalK1, 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).
## Parameters
- `series` - An input series to be aggregated
- `op` - A function that takes a series and produces an optional aggregated result
- `level` - A delegate that returns a new group key, based on the key in the input series
[category:Hierarchical index operations]
| |
ConvertT, R, K |
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_.
## Parameters
- `forward` - Function that converts original values to the new
- `backward` - Function that converts new values back to the original
## Remarks
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.
| |
CountKeysK, T |
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.
[category:Accessing series data and lookup]
| |
CountValuesK, T |
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.).
[category:Accessing series data and lookup]
| |
DiffK, 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]
## 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, containing values that support the `-` operator.
[category:Series transformations]
| |
DropMissingK, 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.
## Parameters
- `series` - An input series to be filtered
## Example
let s = series [ 1 => 1.0; 2 => Double.NaN ]
s |> Series.dropMissing
[fsi:val it : Series<int,float> = series [ 1 => 1]
[category:Missing values]
| |
fillErrorsWithT, K |
Givnen a series of `tryval<'V>` values, returns a new series where all `Error`
values are filled with the specified constant value.
[category:Processing series with exceptions]
| |
FillMissingK, 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.
## Parameters
- `series` - An input series that is to be filled
- `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.
## 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
[category:Missing values]
| |
FillMissingBetweenK, T |
Fill missing values only between `startKey` and `endKey`, inclusive.
## Parameters
- `series` - An input series that is to be filled
- `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.
- `startKey` - the lower bound at which values should be filled
- `endKey` - the upper bound at which values should be filled
[category:Missing values]
| |
FillMissingInsideK, T |
Fill missing values only between the first and last non-missing values.
[category:Missing values]
| |
FillMissingUsingK, T |
Fill missing values in the series using the specified function.
The specified function is called with all keys for which the series
does not contain value and the result of the call is used in place
of the missing value.
## Parameters
- `series` - An input series that is to be filled
- `f` - A function that takes key `K` and generates a value to be
used in a place where the original series contains a missing value.
## Remarks
This function can be used to implement more complex interpolation.
For example see [handling missing values in the tutorial](../frame.html#missing)
[category:Missing values]
| |
FillMissingWitha, K, T |
Fill missing values in the series with a constant value.
## Parameters
- `series` - An input series that is to be filled
- `value` - A constant value that is used to fill all missing values
[category:Missing values]
| |
FilterK, 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.
[category:Series transformations]
| |
FilterAllK, 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.
[category:Series transformations]
| |
FilterValuesT, K |
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.
[category:Series transformations]
| |
FlattenK, 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.
[category:Series transformations]
| |
FoldValuesa, T, K |
Aggregates the values of the specified series using a function that can combine
individual values. The folding starts with the specified initial value.
## Parameters
- `series` - An input series to be aggregated
- `init` - An initial value for the aggregation
- `op` - A function that is used to aggregate elements of the series with the current state
[category:Series transformations]
| |
ForceK, 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.
[category:Series transformations]
| |
GetK, T |
Get the value for the specified key.
Uses exact lookup semantics for key lookup - use `lookup` for more options
[category:Accessing series data and lookup]
| |
GetAllObservationsK, T |
Returns all keys from the sequence, together with the associated (optional) values.
[category:Accessing series data and lookup]
| |
GetAllValuesK, T |
Returns the series values (both missing and present) as a sequence
[category:Accessing series data and lookup]
| |
GetAtK, T |
Returns the value at the specified (integer) offset.
[category:Accessing series data and lookup]
| |
GetFirstKeyK, V |
Returns the first key of the series, or throws exception if one doesn't exist
[category:Accessing series data and lookup]
| |
GetFirstValueK, V |
Returns the first value of the series. This fails if the first value is missing.
[category:Accessing series data and lookup]
| |
GetKeysK, T |
Returns the keys of the series as a sequence
[category:Accessing series data and lookup]
| |
GetLastKeyK, V |
Returns the last key of the series, or throws exception if one doesn't exist
[category:Accessing series data and lookup]
| |
GetLastValueK, V |
Returns the last value of the series. This fails if the last value is missing.
[category:Accessing series data and lookup]
| |
GetObservationsK, T(SeriesK, T) |
Return observations with available values. The operation skips over
all keys with missing values (such as values created from `null`,
`Double.NaN`, or those that are missing due to outer join etc.).
[category:Accessing series data and lookup]
| |
GetObservationsK, T(IEnumerableK, SeriesK, T) |
Create a new series that contains values for all provided keys.
Uses exact lookup semantics for key lookup - use `lookupAll` for more options
## Parameters
- `keys` - A sequence of keys that will form the keys of the retunred sequence
[category:Accessing series data and lookup]
| |
GetValuesK, T |
Returns the (non-missing) values of the series as a sequence
[category:Accessing series data and lookup]
| |
groupByK, T, TNewKey |
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.
## Parameters
- `keySelector` - Generates a new key that is used for aggregation, based on the original
key and value. The new key must support equality testing.
- `series` - An input series to be grouped.
[category:Grouping, windowing and chunking]
| |
groupIntoK, T, 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.
## Parameters
- `keySelector` - Generates a new key that is used for aggregation, based on the original
key and value. The new key must support equality testing.
- `f` - A function to aggregate each group of collected elements.
- `series` - An input series to be grouped.
[category:Grouping, windowing and chunking]
| |
HasK, T |
Returns true when the series contains value for the specified key
(This is useful for checking prior to performing a computation)
[category:Accessing series data and lookup]
| |
HasAllK, T |
Returns true when the series contains value for all of the specified keys
(This is useful for checking prior to performing a computation)
[category:Accessing series data and lookup]
| |
HasNoneK, T |
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)
[category:Accessing series data and lookup]
| |
HasNotK, T |
Returns true when the series does not contains value for the specified key
(This is useful for checking prior to performing a computation)
[category:Accessing series data and lookup]
| |
HasSomeK, T |
Returns true when the series contains value for some of the specified keys
(This is useful for checking prior to performing a computation)
[category:Accessing series data and lookup]
| |
ChunkK, 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.
## Parameters
- `size` - The size of the chunk.
- `series` - The input series to be aggregated.
[category:Grouping, windowing and chunking]
| |
ChunkDistanceD, 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.
## Parameters
- `distance` - 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` - The input series to be aggregated.
[category:Grouping, windowing and chunking]
| |
ChunkDistanceIntoD, 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.
## Parameters
- `distance` - 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` - A value selector that is called to aggregate each chunk.
- `series` - The input series to be aggregated.
[category:Grouping, windowing and chunking]
| |
ChunkIntoK, 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.
## Parameters
- `size` - The size of the chunk.
- `series` - The input series to be aggregated.
[category:Grouping, windowing and chunking]
| |
ChunkSizeK, 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).
## Parameters
- `bounds` - Specifies the chunk size and bounary behavior. The boundary behavior
can be `Boundary.Skip` (meaning that no incomplete chunks are produced),
`Boundary.AtBeginning` (meaning that incomplete chunks are produced at the beginning)
or `Boundary.AtEnding` (to produce incomplete chunks at the end of series)
- `series` - The input series to be aggregated.
[category:Grouping, windowing and chunking]
| |
ChunkSizeIntoK, 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).
## Parameters
- `bounds` - Specifies the chunk size and bounary behavior. The boundary behavior
can be `Boundary.Skip` (meaning that no incomplete chunks are produced),
`Boundary.AtBeginning` (meaning that incomplete chunks are produced at the beginning)
or `Boundary.AtEnding` (to produce incomplete chunks at the end of series)
- `f` - A value selector that is called to aggregate each chunk.
- `series` - The input series to be aggregated.
[category:Grouping, windowing and chunking]
| |
ChunkWhileK, 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.
## Parameters
- `cond` - A function that is called on the first and the last key of a chunk
to determine when a window should end.
- `series` - The input series to be aggregated.
[category:Grouping, windowing and chunking]
| |
ChunkWhileIntoK, 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.
## Parameters
- `cond` - A function that is called on the first and the last key of a chunk
to determine when a window should end.
- `f` - A value selector that is called to aggregate each chunk.
- `series` - The input series to be aggregated.
[category:Grouping, windowing and chunking]
| |
IndexOrdinallyK, T |
Return a new series containing the same values as the original series, but with
ordinal index formed by `int` values starting from 0.
[category:Sorting and index manipulation]
| |
IndexWithK2, K1, 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.
[category:Sorting and index manipulation]
| |
LookupK, T |
Get the value for the specified key.
Use the specified lookup semantics - for exact matching, use `get`
[category:Accessing series data and lookup]
| |
LookupAllK, T |
Create a new series that contains values for all provided keys.
Use the specified lookup semantics - for exact matching, use `getAll`
## Parameters
- `keys` - A sequence of keys that will form the keys of the retunred sequence
- `lookup` - Lookup behavior to use when the value at the specified key does not exist
[category:Accessing series data and lookup]
| |
lookupTimeK, 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`.
## Parameters
- `series` - An input series to be resampled
- `interval` - The interval between the individual samples
- `dir` - Specifies how the keys should be generated. `Direction.Forward` means that the
key is the smallest value of each chunk (and so first key of the series is returned and
the last is not, unless it matches exactly _start + k*interval_); `Direction.Backward`
means that the first key is skipped and sample is generated at, or just before the end
of interval and at the end of the series.
- `lookup` - Specifies how the lookup based on keys is performed. `Exact` means that the
values at exact keys will be returned; `NearestGreater` returns the nearest greater key value
(starting at the first key) and `NearestSmaller` returns the nearest smaller key value
(starting at most `interval` after the end of the series)
## Remarks
This operation is only supported on ordered series. The method throws
`InvalidOperationException` when the series is not ordered.
[category:Sampling, resampling and advanced lookup]
| |
lookupTimeAtK, 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`.
## Parameters
- `series` - An input series to be resampled
- `start` - The initial time to be used for sampling
- `interval` - The interval between the individual samples
- `dir` - Specifies how the keys should be generated. `Direction.Forward` means that the
key is the smallest value of each chunk (and so first key of the series is returned and
the last is not, unless it matches exactly _start + k*interval_); `Direction.Backward`
means that the first key is skipped and sample is generated at, or just before the end
of interval and at the end of the series.
- `lookup` - Specifies how the lookup based on keys is performed. `Exact` means that the
values at exact keys will be returned; `NearestGreater` returns the nearest greater key value
(starting at the first key) and `NearestSmaller` returns the nearest smaller key value
(starting at most `interval` after the end of the series)
## Remarks
This operation is only supported on ordered series. The method throws
`InvalidOperationException` when the series is not ordered.
[category:Sampling, resampling and advanced lookup]
| |
MapK, T, 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.
[category:Series transformations]
| |
MapAllK, T, 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.
[category:Series transformations]
| |
MapKeysK, R, T |
Returns a new series whose keys are the results of applying the given function to
keys of the original series.
[category:Series transformations]
| |
MapValuesT, R, K |
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`.
[category:Series transformations]
| |
MergeK, 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.
[category:Joining, merging and zipping]
| |
MergeAllK, 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.
[category:Joining, merging and zipping]
| |
MergeUsingK, V |
Merge two series with possibly overlapping keys. The `behavior` parameter specifies
how to handle situation when a value is definedin both series.
## Parameters
- `behavior` 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` - the first (left) series to be merged
- `series2` - the second (right) series to be merged
[category:Joining, merging and zipping]
| |
PairwiseK, 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).
## Parameters
- `series` - The input series to be aggregated.
## Example
let input = series [ 1 => 'a'; 2 => 'b'; 3 => 'c']
let res = input |> Series.pairwise
res = series [2 => ('a', 'b'); 3 => ('b', 'c') ]
[category:Grouping, windowing and chunking]
| |
PairwiseWithK, T, 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).
## Parameters
- `f` - A function that is called for each pair to produce result in the final series.
- `series` - The input series to be aggregated.
[category:Grouping, windowing and chunking]
| |
RealignK, 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.
[category:Sorting and index manipulation]
| |
ReduceLevelK1, 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).
## Parameters
- `series` - An input series to be aggregated
- `op` - A function that is used to aggregate elements of each group
- `level` - A delegate that returns a new group key, based on the key in the input series
[category:Hierarchical index operations]
| |
ReduceValuesT, K |
Aggregates the values of the specified series using a function that can combine
individual values. Fails if the series contains no values.
## Parameters
- `series` - An input series to be aggregated
- `op` - A function that is used to aggregate elements of the series
[category:Series transformations]
| |
resampleK, 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.
## Parameters
- `series` - An input series to be resampled
- `keys` - A collection of keys to be used for resampling of the series
- `dir` - If this parameter is `Direction.Forward`, then each key is
used as the smallest key in a chunk; for `Direction.Backward`, the keys are
used as the greatest keys in a chunk.
## Remarks
This operation is only supported on ordered series. The method throws
`InvalidOperationException` when the series is not ordered.
[category:Sampling, resampling and advanced lookup]
| |
resampleEquivK1, 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.
## Parameters
- `series` - An input series to be resampled
- `keyProj` - A function that transforms keys from original space to a new
space (which is then used for grouping based on equivalence)
## Remarks
This 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`.
[category:Sampling, resampling and advanced lookup]
| |
resampleEquivIntoK1, 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`.
## Parameters
- `series` - An input series to be resampled
- `keyProj` - A function that transforms keys from original space to a new
space (which is then used for grouping based on equivalence)
- `f` - A function that is used to collapse a generated chunk into a
single value.
## Remarks
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`.
[category:Sampling, resampling and advanced lookup]
| |
resampleIntoK, V, 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`.
## Parameters
- `series` - An input series to be resampled
- `keys` - A collection of keys to be used for resampling of the series
- `dir` - If this parameter is `Direction.Forward`, then each key is
used as the smallest key in a chunk; for `Direction.Backward`, the keys are
used as the greatest keys in a chunk.
- `f` - A function that is used to collapse a generated chunk into a
single value. Note that this function may be called with empty series.
## Remarks
This operation is only supported on ordered series. The method throws
`InvalidOperationException` when the series is not ordered.
[category:Sampling, resampling and advanced lookup]
| |
resampleUniformK1, K2, 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.
## Parameters
- `series` - An input series to be resampled
- `fillMode` - When set to `Lookup.NearestSmaller` or `Lookup.NearestGreater`,
the function searches for a nearest available observation in an neighboring chunk.
Otherwise, the function `f` is called with an empty series as an argument.
- `keyProj` - A function that transforms keys from original space to a new
space (which is then used for grouping based on equivalence)
- `nextKey` - A function that gets the next key in the transformed space
## Remarks
This operation is only supported on ordered series. The method throws
`InvalidOperationException` when the series is not ordered.
[category:Sampling, resampling and advanced lookup]
| |
resampleUniformIntoK1, K2, V, 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.
## Parameters
- `series` - An input series to be resampled
- `fillMode` - 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` - A function that transforms keys from original space to a new
space (which is then used for grouping based on equivalence)
- `nextKey` - A function that gets the next key in the transformed space
- `f` - 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`.
## Remarks
This operation is only supported on ordered series. The method throws
`InvalidOperationException` when the series is not ordered.
[category:Sampling, resampling and advanced lookup]
| |
ReverseK, T |
Returns a new series, containing the observations of the original series in a reverse order.
[category:Sorting and index manipulation]
| |
SampleK, T |
Sample an (ordered) series by finding the value at the exact or closest prior key
for some new sequence of keys.
## Parameters
- `keys` - A sequence of keys that will form the keys of the retunred sequence
[category:Accessing series data and lookup]
| |
sampleTimea, 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.
## Parameters
- `series` - An input series to be resampled
- `interval` - The interval between the individual samples
- `dir` - If this parameter is `Direction.Forward`, then each key is
used as the smallest key in a chunk; for `Direction.Backward`, the keys are
used as the greatest keys in a chunk.
## Remarks
This operation is only supported on ordered series. The method throws
`InvalidOperationException` when the series is not ordered.
[category:Sampling, resampling and advanced lookup]
| |
sampleTimeAta, 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.
## Parameters
- `series` - An input series to be resampled
- `start` - The initial time to be used for sampling
- `interval` - The interval between the individual samples
- `dir` - If this parameter is `Direction.Forward`, then each key is
used as the smallest key in a chunk; for `Direction.Backward`, the keys are
used as the greatest keys in a chunk.
## Remarks
This operation is only supported on ordered series. The method throws
`InvalidOperationException` when the series is not ordered.
[category:Sampling, resampling and advanced lookup]
| |
sampleTimeAtIntoK, 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.
## Parameters
- `series` - An input series to be resampled
- `start` - The initial time to be used for sampling
- `interval` - The interval between the individual samples
- `dir` - If this parameter is `Direction.Forward`, then each key is
used as the smallest key in a chunk; for `Direction.Backward`, the keys are
used as the greatest keys in a chunk.
- `f` - A function that is called to aggregate each chunk into a single value.
## Remarks
This operation is only supported on ordered series. The method throws
`InvalidOperationException` when the series is not ordered.
[category:Sampling, resampling and advanced lookup]
| |
sampleTimeIntoK, 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.
## Parameters
- `series` - An input series to be resampled
- `interval` - The interval between the individual samples
- `dir` - If this parameter is `Direction.Forward`, then each key is
used as the smallest key in a chunk; for `Direction.Backward`, the keys are
used as the greatest keys in a chunk.
- `f` - A function that is called to aggregate each chunk into a single value.
## Remarks
This operation is only supported on ordered series. The method throws
`InvalidOperationException` when the series is not ordered.
[category:Sampling, resampling and advanced lookup]
| |
ScanAllValuesR, T, K |
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.
## Parameters
- `foldFunc` - A folding function
- `init` - An initial value
- `series` - The series over whose values to scan
[category:Series transformations]
| |
ScanValuesR, T, K |
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.
## Parameters
- `foldFunc` - A folding function
- `init` - An initial value
- `series` - The series over whose values to scan
[category:Series transformations]
| |
ShiftK, 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]
## Parameters
- `offset` - Can be both positive and negative number.
- `series` - The input series to be shifted.
## Remarks
If you want to calculate the difference, e.g. `s - (Series.shift 1 s)`, you can
use `Series.diff` which will be a little bit faster.
[category:Series transformations]
| |
SkipK, T |
Returns a series that contains the data from the original series,
except for the first `count` keys.
## Parameters
- `count` - Number of keys to skip; must be smaller or equal to the original number of keys
- `series` - Input series from which the keys are taken
[category:Series transformations]
| |
SkipLastK, T |
Returns a series that contains the data from the original series,
except for the last `count` keys.
## Parameters
- `count` - Number of keys to skip; must be smaller or equal to the original number of keys
- `series` - Input series from which the keys are taken
[category:Series transformations]
| |
SortK, 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.
[category:Sorting and index manipulation]
| |
SortByT, V, K |
Returns a new series, containing the observations of the original series sorted by
values returned by the specified projection function.
## Parameters
- `series` - An input series whose values are sorter
- `proj` - A projection function that returns a value to be compared for each
value contained in the original input series.
[category:Sorting and index manipulation]
| |
SortByKeyK, T |
Returns a new series whose observations are sorted according to keys of the index.
## Parameters
- `series` - An input series to be sorted
[category:Sorting and index manipulation]
| |
SortWithV, K |
Returns a new series, containing the observations of the original series sorted using
the specified comparison function.
## Parameters
- `series` - An input series whose values are sorter
- `comparer` - 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.
[category:Sorting and index manipulation]
| |
TakeK, T |
Returns a series that contains the specified number of keys from the original series.
## Parameters
- `count` - Number of keys to take; must be smaller or equal to the original number of keys
- `series` - Input series from which the keys are taken
[category:Series transformations]
| |
TakeLastK, 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.
## Parameters
- `count` - Number of keys to take; must be smaller or equal to the original number of keys
- `series` - Input series from which the keys are taken
[category:Series transformations]
| |
tryErrorsK, V |
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.
[category:Processing series with exceptions]
| |
TryGetK, T |
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
[category:Accessing series data and lookup]
| |
TryGetAtK, T |
Returns the value at the specified (integer) offset, or `None` if the value is missing.
[category:Accessing series data and lookup]
| |
TryGetFirstValueK, V |
Returns the last value of the series if one exists.
[category:Accessing series data and lookup]
| |
TryGetLastValueK, V |
Returns the last value of the series if one exists.
[category:Accessing series data and lookup]
| |
TryLookupK, T |
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`.
[category:Accessing series data and lookup]
| |
TryLookupObservationK, T |
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.
[category:Accessing series data and lookup]
| |
tryMapK, T, R |
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.
[category:Processing series with exceptions]
| |
trySuccessesK, 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.
[category:Processing series with exceptions]
| |
tryValuesK, 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.
[category:Processing series with exceptions]
| |
WindowK, 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.
## Parameters
- `size` - The size of the sliding window.
- `series` - The input series to be aggregated.
[category:Grouping, windowing and chunking]
| |
WindowDistanceD, 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.
## Parameters
- `distance` - 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` - The input series to be aggregated.
[category:Grouping, windowing and chunking]
| |
WindowDistanceIntoa, 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.
## Parameters
- `distance` - 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` - A function that is used to aggregate each window into a single value.
- `series` - The input series to be aggregated.
[category:Grouping, windowing and chunking]
| |
WindowIntoK, 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.
## Parameters
- `size` - The size of the sliding window.
- `series` - The input series to be aggregated.
- `f` - A function that is called on each created window.
[category:Grouping, windowing and chunking]
| |
WindowSizeK, 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).
## Parameters
- `bounds` - Specifies the window size and bounary behavior. The boundary behavior
can be `Boundary.Skip` (meaning that no incomplete windows are produced),
`Boundary.AtBeginning` (meaning that incomplete windows are produced at the beginning)
or `Boundary.AtEnding` (to produce incomplete windows at the end of series)
- `series` - The input series to be aggregated.
[category:Grouping, windowing and chunking]
| |
WindowSizeIntoK, T, 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).
## Parameters
- `bounds` - Specifies the window size and bounary behavior. The boundary behavior
can be `Boundary.Skip` (meaning that no incomplete windows are produced),
`Boundary.AtBeginning` (meaning that incomplete windows are produced at the beginning)
or `Boundary.AtEnding` (to produce incomplete windows at the end of series)
- `f` - A value selector that is called to aggregate each window.
- `series` - The input series to be aggregated.
[category:Grouping, windowing and chunking]
| |
WindowWhileK, 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.
## Parameters
- `cond` - A function that is called on the first and the last key of a window
to determine when a window should end.
- `series` - The input series to be aggregated.
[category:Grouping, windowing and chunking]
| |
WindowWhileIntoK, 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.
## Parameters
- `cond` - A function that is called on the first and the last key of a window
to determine when a window should end.
- `f` - A function that is used to aggregate each window into a single value.
- `series` - The input series to be aggregated.
[category:Grouping, windowing and chunking]
| |
WithMissingFromK, S, 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.
[category:Missing values]
| |
ZipK, V1, V2 |
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.
[category:Joining, merging and zipping]
| |
ZipAlignK, V1, V2 |
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.
## Parameters
- `kind` 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` 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` - The first (left) series to be aligned
- `series2` - The second (right) series to be aligned
[category:Joining, merging and zipping]
| |
ZipAlignIntoV1, V2, R, K |
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
## Parameters
- `kind` 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` 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` - 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` - The first (left) series to be aligned
- `series2` - The second (right) series to be aligned
[category:Joining, merging and zipping]
| |
ZipInnerK, 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.
[category:Joining, merging and zipping]
| |
ZipIntoV1, V2, R, K |
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
## Parameters
- `op` - A function that combines values from the two series.
- `series1` - The first (left) series to be aligned
- `series2` - The second (right) series to be aligned
[category:Joining, merging and zipping]
|