Series<'K, 'V> Type
The type Series<K, V> represents a data series consisting of values `V` indexed by
keys `K`. The keys of a series may or may not be ordered
Table of contents
- Other module members
- Accessors and slicing
- Indexing
- Merging, joining and zipping
- Operators
- Projection and filtering
- Resamping
- Resampling
- Series data
- Windowing, chunking and grouping
Other module members
Constructors
| Constructor |
Description
|
|
|
|
|
|
|
Full Usage:
Series(index, vector, vectorBuilder, indexBuilder)
Parameters:
IIndex<'K>
vector : IVector<'V>
vectorBuilder : IVectorBuilder
indexBuilder : IIndexBuilder
Returns: Series<'K, 'V>
|
|
Instance members
| Instance member |
Description
|
|
|
|
|
|
|
Full Usage:
this.Between
Parameters:
'K
upperInclusive : 'K
Returns: Series<'K, 'V>
|
|
|
|
Full Usage:
this.Format
Parameters:
int
endCount : int
showInfo : bool
Returns: string
|
|
Full Usage:
this.Format
Parameters:
int
-
The total number of items to show. The result will show at most `itemCount/2` items at the beginning and ending of the series.
Returns: string
|
Shows the series content in a human-readable format. The resulting string shows a limited number of values from the series.
|
Full Usage:
this.Format
Parameters:
bool
Returns: string
|
|
Full Usage:
this.Format
Returns: string
|
Shows the series content in a human-readable format. The resulting string shows a limited number of values from the series.
|
Full Usage:
this.FormatStrings
Parameters:
int
-
The number of elements to show at the beginning of the series
endCount : int
-
The number of elements to show at the end of the series
Returns: string[][]
|
Shows the series content in a human-readable format. The resulting string shows a limited number of values from the series.
|
Full Usage:
this.GetAddressRange
Parameters:
RangeRestriction<Address>
Returns: Series<'K, 'V>
|
Internal helper used by `skip`, `take`, etc.
|
|
|
|
|
|
|
Static members
| Static member |
Description
|
|
Custom operator that can be used for applying a function to all elements of
a series. This provides a nicer syntactic sugar for the `Series.mapValues`
function. For example:
// Given a float series and a function on floats
let s1 = Series.ofValues [ 1.0 .. 10.0 ]
let adjust v = max 10.0 v
// Apply "adjust (v + v)" to all elements
adjust $ (s1 + s1)
|
Accessors and slicing
Instance members
| Instance member |
Description
|
Full Usage:
this.Get
Parameters:
'K
Returns: 'V
|
Gets the value at the specified key. Fails if not found.
|
Gets the value at the specified key using the specified lookup semantics. Fails if not found.
|
|
Full Usage:
this.GetAt
Parameters:
int
Returns: 'V
|
Gets the value at the specified index position.
|
|
Performs a hierarchical lookup by applying a custom lookup on the series index.
|
Full Usage:
this.GetItems
Parameters:
'K seq
-
A collection of keys in the current series.
lookup : Lookup
-
Specifies the lookup behavior when searching for keys in the current series. `Lookup.NearestGreater` and `Lookup.NearestSmaller` can be used when the current series is ordered.
Returns: Series<'K, 'V>
|
Returns a new series with an index containing the specified keys. When the key is not found in the current series, the newly returned series will contain a missing value. When the second parameter is not specified, the keys have to exactly match the keys in the current series (`Lookup.Exact`).
|
Full Usage:
this.GetItems
Parameters:
'K seq
-
A collection of keys in the current series.
Returns: Series<'K, 'V>
|
Returns a new series with an index containing the specified keys. When the key is not found in the current series, the newly returned series will contain a missing value. When the second parameter is not specified, the keys have to exactly match the keys in the current series (`Lookup.Exact`).
|
Full Usage:
this.GetKeyAt
Parameters:
int
Returns: 'K
|
Gets the key at the specified index position.
|
|
Gets the value and key at the specified key. Fails if not found.
|
|
Gets the value and key at the specified lookup semantics. Fails if not found.
|
|
|
Full Usage:
this.GetSubrange
Parameters:
('K * BoundaryBehavior) option
hi : ('K * BoundaryBehavior) option
Returns: Series<'K, 'V>
|
|
|
|
|
|
Full Usage:
this[a]
Parameters:
'K
Returns: 'V
|
Gets the value at the specified key.
|
|
|
|
Attempts to get the value at the specified key using the specified lookup semantics.
|
|
|
Full Usage:
this.TryGetObservation
Parameters:
'K
Returns: OptionalValue<KeyValuePair<'K, OptionalValue<'V>>>
|
Attempts to get a value at the specified 'key'
|
Full Usage:
this.TryGetObservation
Parameters:
'K
lookup : Lookup
Returns: OptionalValue<KeyValuePair<'K, 'V>>
|
Attempts to get the value and key at the specified lookup semantics.
|
Static members
| Static member |
Description
|
|
Dynamic operator for accessing series values by key using the `?` syntax.
|
Indexing
Instance members
| Instance member |
Description
|
|
Replace the index of the series with ordinally generated integers starting from zero. The elements of the series are assigned index according to the current order, or in a non-deterministic way, if the current index is not ordered.
|
|
|
|
|
Merging, joining and zipping
Instance members
| Instance member |
Description
|
|
|
|
|
Full Usage:
this.Merge
Parameters:
Series<'K, 'V>
behavior : UnionBehavior
Returns: Series<'K, 'V>
|
|
|
|
|
|
|
|
Full Usage:
this.Replace
Parameters:
'K
-
A key to be used for replacing of the series
value : 'V
-
A value to replace value for `key`
Returns: Series<'K, 'V>
|
Replace series values given in keys with value.
|
Full Usage:
this.Replace
Parameters:
'K[]
-
An array of keys to be used for replacing of the series
value : 'V
-
A value to replace any values for `keys`
Returns: Series<'K, 'V>
|
Replace series values given in keys with value.
|
|
Operators
Static members
| Static member |
Description
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Projection and filtering
Instance members
| Instance member |
Description
|
|
|
|
|
Full Usage:
this.ScanAllValues
Parameters:
Func<OptionalValue<'S>, OptionalValue<'V>, OptionalValue<'S>>
init : OptionalValue<'S>
Returns: Series<'K, 'S>
|
|
|
|
|
|
|
|
Full Usage:
this.SelectKeys
Parameters:
Func<KeyValuePair<'K, OptionalValue<'V>>, 'R>
Returns: Series<'R, 'V>
|
|
Full Usage:
this.SelectOptional
Parameters:
Func<KeyValuePair<'K, OptionalValue<'V>>, OptionalValue<'R>>
Returns: Series<'K, 'R>
|
|
|
|
|
|
Full Usage:
this.Where
Parameters:
Func<KeyValuePair<'K, 'V>, int, bool>
Returns: Series<'K, 'V>
|
|
Full Usage:
this.WhereOptional
Parameters:
Func<KeyValuePair<'K, OptionalValue<'V>>, bool>
Returns: Series<'K, 'V>
|
|
|
Resamping
Instance members
| Instance member |
Description
|
Full Usage:
this.Resample
Parameters:
'K seq
-
A collection of keys to be used for resampling of the series
direction : 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.
valueSelector : Func<'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.
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 `valueSelector` and `keySelector` (an overload that does not take `keySelector` just selects the explicitly provided key). This operation is only supported on ordered series. The method throws `InvalidOperationException` when the series is not ordered.
|
Resampling
Instance members
| Instance member |
Description
|
Full Usage:
this.Resample
Parameters:
'K seq
-
A collection of keys to be used for resampling of the series
direction : 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.
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). The chunks are then returned as a nested series. This operation is only supported on ordered series. The method throws `InvalidOperationException` when the series is not ordered.
|
Full Usage:
this.Resample
Parameters:
'K seq
-
A collection of keys to be used for resampling of the series
direction : 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.
valueSelector : Func<'TNewKey, Series<'K, 'V>, 'R>
-
A function that is used to collapse a generated chunk into a single value. Note that this function may be called with empty series.
keySelector : Func<'K, Series<'K, 'V>, 'TNewKey>
-
A function that is used to generate a new key for each chunk.
Returns: Series<'TNewKey, 'R>
|
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 `valueSelector` and `keySelector` (an overload that does not take `keySelector` just selects the explicitly provided key). This operation is only supported on ordered series. The method throws `InvalidOperationException` when the series is not ordered.
|
Series data
Instance members
| Instance member |
Description
|
|
Returns the index associated with this series. This member should not generally be accessed directly, because all functionality is exposed through series operations.
|
Full Usage:
this.IsEmpty
Returns: bool
|
Gets a value indicating whether the series is empty.
|
Full Usage:
this.IsOrdered
Returns: bool
|
Gets a value indicating whether the series index is ordered.
|
Full Usage:
this.KeyCount
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.
|
Full Usage:
this.KeyRange
Returns: 'K * 'K
|
Gets the range of keys in the series.
|
Full Usage:
this.Keys
Returns: 'K seq
|
Returns a collection of keys that are defined by the index of this series. Note that the length of this sequence does not match the `Values` sequence if there are missing values. To get matching sequence, use the `Observations` property or `Series.observation`.
|
|
Returns a collection of observations that form this series. Note that this property
skips over all missing (or NaN) values. Observations are returned as
|
|
Returns a collection of observations that form this series. Note that this property
includes all missing (or NaN) values. Observations are returned as
|
Full Usage:
this.ValueCount
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.).
|
Full Usage:
this.Values
Returns: 'V seq
|
Returns a collection of values that are available in the series data. Note that the length of this sequence does not match the `Keys` sequence if there are missing values. To get matching sequence, use the `Observations` property or `Series.observation`.
|
Full Usage:
this.ValuesAll
Returns: 'V seq
|
Returns a collection of values, including possibly missing values. Note that the length of this sequence matches the `Keys` sequence.
|
|
Returns the vector associated with this series. This member should not generally be accessed directly, because all functionality is exposed through series operations.
|
Windowing, chunking and grouping
Instance members
| Instance member |
Description
|
Full Usage:
this.Aggregate
Parameters:
Aggregation<'K>
-
Specifies the aggregation method using Aggregation<K>. This is a discriminated union listing various chunking and windowing conditions.
observationSelector : Func<DataSegment<Series<'K, 'V>>, KeyValuePair<'TNewKey, OptionalValue<'R>>>
-
A function that is called on each chunk to obtain a key and a value.
Returns: Series<'TNewKey, 'R>
|
Aggregates an ordered series using the method specified by
|
Full Usage:
this.Aggregate
Parameters:
Aggregation<'K>
-
Specifies the aggregation method using Aggregation<K>. This is a discriminated union listing various chunking and windowing conditions.
keySelector : Func<DataSegment<Series<'K, 'V>>, 'TNewKey>
-
A function that is called on each chunk to obtain a key.
valueSelector : Func<DataSegment<Series<'K, 'V>>, OptionalValue<'R>>
-
A value selector function that is called to aggregate each chunk or window.
Returns: Series<'TNewKey, 'R>
|
Aggregates an ordered series using the method specified by
|
Full Usage:
this.GroupBy
Parameters:
Func<KeyValuePair<'K, 'V>, 'TNewKey>
-
Generates a new key that is used for aggregation, based on the original key and value. The new key must support equality testing.
Returns: Series<'TNewKey, Series<'K, 'V>>
|
Groups a series (ordered or unordered) using the specified key selector (`keySelector`)
|
Full Usage:
this.Interpolate
Parameters:
'K seq
-
Sequence of new keys that forms the index of interpolated results
f : Func<'K, OptionalValue<KeyValuePair<'K, 'V>>, OptionalValue<KeyValuePair<'K, 'V>>, 'V>
-
Function to do the interpolating
Returns: Series<'K, 'V>
|
Interpolates an ordered series given a new sequence of keys. The function iterates through each new key, and invokes a function on the current key, the nearest smaller and larger valid observations from the series argument. The function must return a new valid float.
|
|
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).
Example
val input: obj
val res: obj
|
Full Usage:
this.Pairwise
Parameters:
Boundary
-
Specifies the direction in which the series is aggregated and how the corner case is handled. If the value is `Boundary.AtEnding`, then the function returns value and its successor, otherwise it returns value and its predecessor.
Returns: Series<'K, DataSegment<'V * 'V>>
|
Returns a series containing an element and its neighbor for each input. The returned series is one key shorter (it does not contain a value for the first or last key depending on `boundary`). If `boundary` is other than `Boundary.Skip`, then the key is included in the returned series, but its value is missing.
Example
val input: obj
val res: obj
|
Deedle