Deedle


Series

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

Accessors and slicing 

Instance members

Instance memberDescription
series.Get(key)
Signature:key:'K -> 'V
series.Get(key, lookup)
Signature:(key:'K * lookup:Lookup) -> 'V
series.GetAt(index)
Signature:index:int -> 'V
series.GetByLevel(key)
Signature:key:ICustomLookup<'K> -> Series<'K,'V>
series.GetItems(keys, lookup)
Signature:(keys:seq<'K> * lookup:Lookup) -> 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).

Parameters

  • keys - A collection of keys in the current series.
  • 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.
series.GetItems(keys)
Signature:keys:seq<'K> -> 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).

Parameters

  • keys - A collection of keys in the current series.
series.GetKeyAt(index)
Signature:index:int -> 'K
series.GetObservation(key)
Signature:key:'K -> KeyValuePair<'K,'V>
series.GetObservation(key, lookup)
Signature:(key:'K * lookup:Lookup) -> KeyValuePair<'K,'V>
series.GetSlice(lo, hi)
Signature:(lo:'K option * hi:'K option) -> Series<'K,'V>
series.GetSubrange(lo, hi)
Signature:(lo:('K * BoundaryBehavior) option * hi:('K * BoundaryBehavior) option) -> Series<'K,'V>
series.[a]
Signature:a:ICustomLookup<'K> -> Series<'K,'V>
series.[items]
Signature:items:seq<'K> -> Series<'K,'V>
series.[a]
Signature:a:'K -> 'V
series.TryGet(key)
Signature:key:'K -> OptionalValue<'V>
series.TryGet(key, lookup)
Signature:(key:'K * lookup:Lookup) -> OptionalValue<'V>
series.TryGetAt(index)
Signature:index:int -> OptionalValue<'V>
series.TryGetObservation(key)
Signature:key:'K -> OptionalValue<KeyValuePair<'K,'V>>

Attempts to get a value at the specified 'key'

series.TryGetObservation(key, lookup)
Signature:(key:'K * lookup:Lookup) -> OptionalValue<KeyValuePair<'K,'V>>

Static members

Static memberDescription
Series.( ? )(series, name)
Signature:(series:Series<string,'?6194> * name:string) -> '?6194
Type parameters: '?6194

Appending, joining and zipping 

Instance members

Instance memberDescription
series.Append(otherSeries)
Signature:otherSeries:Series<'K,'V> -> Series<'K,'V>
series.Union(another, behavior)
Signature:(another:Series<'K,'V> * behavior:UnionBehavior) -> Series<'K,'V>
series.Union(another)
Signature:another:Series<'K,'V> -> Series<'K,'V>
series.Zip(otherSeries, kind, lookup)
Signature:(otherSeries:Series<'K,'V2> * kind:JoinKind * lookup:Lookup) -> Series<'K,('V opt * 'V2 opt)>
Type parameters: 'V2
series.Zip(otherSeries, kind)
Signature:(otherSeries:Series<'K,'V2> * kind:JoinKind) -> Series<'K,('V opt * 'V2 opt)>
Type parameters: 'V2
series.Zip(otherSeries)
Signature:otherSeries:Series<'K,'V2> -> Series<'K,('V opt * 'V2 opt)>
Type parameters: 'V2
series.ZipInner(otherSeries)
Signature:otherSeries:Series<'K,'V2> -> Series<'K,('V * 'V2)>
Type parameters: 'V2

Indexing 

Instance members

Instance memberDescription
series.IndexOrdinally()
Signature:unit -> Series<int,'V>

Replace the index of the series with ordinarilly 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.

series.IndexWith(keys)
Signature:keys:seq<'TNewKey> -> Series<'TNewKey,'V>
Type parameters: 'TNewKey
series.Realign(newKeys)
Signature:newKeys:seq<'K> -> Series<'K,'V>

Operators 

Static members

Static memberDescription
Series.( - )(s1, s2)
Signature:(s1:Series<'K,float> * s2:Series<'K,float>) -> Series<'K,float>
Series.( - )(s1, s2)
Signature:(s1:Series<'K,int> * s2:Series<'K,int>) -> Series<'K,int>
Series.( - )(series, scalar)
Signature:(series:Series<'K,float> * scalar:float) -> Series<'K,float>
Series.( - )(scalar, series)
Signature:(scalar:float * series:Series<'K,float>) -> Series<'K,float>
Series.( - )(series, scalar)
Signature:(series:Series<'K,int> * scalar:int) -> Series<'K,int>
Series.( - )(scalar, series)
Signature:(scalar:int * series:Series<'K,int>) -> Series<'K,int>
Series.( * )(s1, s2)
Signature:(s1:Series<'K,float> * s2:Series<'K,float>) -> Series<'K,float>
Series.( * )(s1, s2)
Signature:(s1:Series<'K,int> * s2:Series<'K,int>) -> Series<'K,int>
Series.( * )(series, scalar)
Signature:(series:Series<'K,float> * scalar:float) -> Series<'K,float>
Series.( * )(scalar, series)
Signature:(scalar:float * series:Series<'K,float>) -> Series<'K,float>
Series.( * )(series, scalar)
Signature:(series:Series<'K,int> * scalar:int) -> Series<'K,int>
Series.( * )(scalar, series)
Signature:(scalar:int * series:Series<'K,int>) -> Series<'K,int>
Series.( / )(s1, s2)
Signature:(s1:Series<'K,float> * s2:Series<'K,float>) -> Series<'K,float>
Series.( / )(s1, s2)
Signature:(s1:Series<'K,int> * s2:Series<'K,int>) -> Series<'K,int>
Series.( / )(series, scalar)
Signature:(series:Series<'K,float> * scalar:float) -> Series<'K,float>
Series.( / )(scalar, series)
Signature:(scalar:float * series:Series<'K,float>) -> Series<'K,float>
Series.( / )(series, scalar)
Signature:(series:Series<'K,int> * scalar:int) -> Series<'K,int>
Series.( / )(scalar, series)
Signature:(scalar:int * series:Series<'K,int>) -> Series<'K,int>
Series.( + )(s1, s2)
Signature:(s1:Series<'K,float> * s2:Series<'K,float>) -> Series<'K,float>
Series.( + )(s1, s2)
Signature:(s1:Series<'K,int> * s2:Series<'K,int>) -> Series<'K,int>
Series.( + )(series, scalar)
Signature:(series:Series<'K,float> * scalar:float) -> Series<'K,float>
Series.( + )(scalar, series)
Signature:(scalar:float * series:Series<'K,float>) -> Series<'K,float>
Series.( + )(series, scalar)
Signature:(series:Series<'K,int> * scalar:int) -> Series<'K,int>
Series.( + )(scalar, series)
Signature:(scalar:int * series:Series<'K,int>) -> Series<'K,int>
Series.Abs(series)
Signature:series:Series<'K,int> -> Series<'K,int>
Series.Abs(series)
Signature:series:Series<'K,float> -> Series<'K,float>
Series.Acos(series)
Signature:series:Series<'K,float> -> Series<'K,float>
Series.Asin(series)
Signature:series:Series<'K,float> -> Series<'K,float>
Series.Atan(series)
Signature:series:Series<'K,float> -> Series<'K,float>
Series.Ceiling(series)
Signature:series:Series<'K,float> -> Series<'K,float>
Series.Cos(series)
Signature:series:Series<'K,float> -> Series<'K,float>
Series.Cosh(series)
Signature:series:Series<'K,float> -> Series<'K,float>
Series.Exp(series)
Signature:series:Series<'K,float> -> Series<'K,float>
Series.Floor(series)
Signature:series:Series<'K,float> -> Series<'K,float>
Series.Log(series)
Signature:series:Series<'K,float> -> Series<'K,float>
Series.Log10(series)
Signature:series:Series<'K,float> -> Series<'K,float>
Series.Pow(s1, s2)
Signature:(s1:Series<'K,float> * s2:Series<'K,float>) -> Series<'K,float>
Series.Pow(series, scalar)
Signature:(series:Series<'K,float> * scalar:float) -> Series<'K,float>
Series.Pow(scalar, series)
Signature:(scalar:float * series:Series<'K,float>) -> Series<'K,float>
Series.Round(series)
Signature:series:Series<'K,float> -> Series<'K,float>
Series.Sign(series)
Signature:series:Series<'K,float> -> Series<'K,int>
Series.Sin(series)
Signature:series:Series<'K,float> -> Series<'K,float>
Series.Sinh(series)
Signature:series:Series<'K,float> -> Series<'K,float>
Series.Sqrt(series)
Signature:series:Series<'K,float> -> Series<'K,float>
Series.Tan(series)
Signature:series:Series<'K,float> -> Series<'K,float>
Series.Tanh(series)
Signature:series:Series<'K,float> -> Series<'K,float>
Series.Truncate(series)
Signature:series:Series<'K,float> -> Series<'K,float>

Projection and filtering 

Instance members

Instance memberDescription
series.Select(f)
Signature:f:Func<KeyValuePair<'K,'V>,'R> -> Series<'K,'R>
Type parameters: 'R
series.Select(f)
Signature:f:Func<KeyValuePair<'K,'V>,int,'R> -> Series<'K,'R>
Type parameters: 'R
series.SelectKeys(f)
Signature:f:Func<KeyValuePair<'K,OptionalValue<'V>>,'R> -> Series<'R,'V>
Type parameters: 'R
series.SelectOptional(f)
Signature:f:Func<KeyValuePair<'K,OptionalValue<'V>>,OptionalValue<'R>> -> Series<'K,'R>
Type parameters: 'R
series.Where(f)
Signature:f:Func<KeyValuePair<'K,'V>,bool> -> Series<'K,'V>
series.Where(f)
Signature:f:Func<KeyValuePair<'K,'V>,int,bool> -> Series<'K,'V>
series.WhereOptional(f)
Signature:f:Func<KeyValuePair<'K,OptionalValue<'V>>,bool> -> Series<'K,'V>

Resampling 

Instance members

Instance memberDescription
series.Resample(keys, direction)
Signature:(keys:seq<'K> * direction:Direction) -> 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.

Parameters

  • keys - A collection of keys to be used for resampling of the series
  • 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.

Remarks

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

series.Resample(...)
Signature:(keys:seq<'K> * direction:Direction * valueSelector:Func<'K,Series<'K,'V>,'?6253>) -> Series<'K,'?6253>
Type parameters: '?6253

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

Parameters

  • keys - A collection of keys to be used for resampling of the series
  • 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 - 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.

series.Resample(...)
Signature:(keys:seq<'K> * direction:Direction * valueSelector:Func<'TNewKey,Series<'K,'V>,'R> * keySelector:Func<'K,Series<'K,'V>,'TNewKey>) -> Series<'TNewKey,'R>
Type parameters: '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).

Parameters

  • keys - A collection of keys to be used for resampling of the series
  • 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 - 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 - A function that is used to generate a new key for each chunk.

Remarks

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

Series data 

Instance members

Instance memberDescription
series.Index
Signature:IIndex<'K>

Returns the index associated with this series. This member should not generally be accessed directly, because all functionality is exposed through series operations.

series.IsEmpty
Signature:bool
series.IsOrdered
Signature:bool
series.KeyCount
Signature: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.KeyRange
Signature:'K * 'K
series.Keys
Signature:seq<'K>

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.

series.Observations
Signature:seq<KeyValuePair<'K,'V>>

Returns a collection of observations that form this series. Note that this property skips over all missing (or NaN) values. Observations are returned as KeyValuePair<K, V> objects. For an F# alternative that uses tuples, see Series.observations.

series.ValueCount
Signature: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.Values
Signature:seq<'V>

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.

series.Vector
Signature:IVector<'V>

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 memberDescription
series.Aggregate(...)
Signature:(aggregation:Aggregation<'K> * observationSelector:Func<DataSegment<Series<'K,'V>>,KeyValuePair<'TNewKey,OptionalValue<'R>>>) -> Series<'TNewKey,'R>
Type parameters: 'TNewKey, 'R

Aggregates an ordered series using the method specified by Aggregation<K> and then applies the provided observationSelector on each window or chunk to produce the result which is returned as a new series. The selector returns both the key and the value.

Parameters

  • aggregation - Specifies the aggregation method using Aggregation<K>. This is a discriminated union listing various chunking and windowing conditions.
  • observationSelector - A function that is called on each chunk to obtain a key and a value.
series.Aggregate(...)
Signature:(aggregation:Aggregation<'K> * keySelector:Func<DataSegment<Series<'K,'V>>,'TNewKey> * valueSelector:Func<DataSegment<Series<'K,'V>>,OptionalValue<'R>>) -> Series<'TNewKey,'R>
Type parameters: 'TNewKey, 'R

Aggregates an ordered series using the method specified by Aggregation<K> and then applies the provided valueSelector 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.
  • valueSelector - A value selector function that is called to aggregate each chunk or window.
series.GroupBy(...)
Signature:(keySelector:Func<KeyValuePair<'K,'V>,'TNewKey> * valueSelector:Func<KeyValuePair<'TNewKey,Series<'K,'V>>,OptionalValue<'R>>) -> Series<'TNewKey,'R>
Type parameters: 'TNewKey, 'R

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 valueSelector 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.
  • valueSelector - A value selector function that is called to aggregate each group of collected elements.
series.Pairwise()
Signature:unit -> Series<'K,('V * 'V)>

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.Pairwise()
res = series [2 => ('a', 'b'); 3 => ('b', 'c') ]
series.Pairwise(boundary)
Signature:boundary:Boundary -> 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.

Parameters

  • series - The input series to be aggregated.
  • 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.

Example

let input = series [ 1 => 'a'; 2 => 'b'; 3 => 'c']
let res = input.Pairwise()
res = series [2 => ('a', 'b'); 3 => ('b', 'c') ]

Other type members 

Constructors

ConstructorDescription
new Series
Signature:(keys:seq<'K> * values:seq<'V>) -> Series<'K,'V>
new Series
Signature:pairs:seq<KeyValuePair<'K,'V>> -> Series<'K,'V>
new Series
Signature:(index:IIndex<'K> * vector:IVector<'V> * vectorBuilder:IVectorBuilder * indexBuilder:IIndexBuilder) -> Series<'K,'V>

Instance members

Instance memberDescription
series.After(lowerExclusive)
Signature:lowerExclusive:'K -> Series<'K,'V>
series.AsyncMaterialize()
Signature:unit -> Async<Series<'K,'V>>
series.Before(upperExclusive)
Signature:upperExclusive:'K -> Series<'K,'V>
series.Between(...)
Signature:(lowerInclusive:'K * upperInclusive:'K) -> Series<'K,'V>
series.EndAt(upperInclusive)
Signature:upperInclusive:'K -> Series<'K,'V>
series.Format()
Signature:unit -> string

Shows the data frame content in a human-readable format. The resulting string shows all columns, but a limited number of rows. The property is used automatically by F# Interactive.

series.IndexBuilder
Signature:IIndexBuilder

Returns the index builder associated with this series

series.Materialize()
Signature:unit -> Series<'K,'V>
series.MaterializeAsync()
Signature:unit -> Task<Series<'K,'V>>
series.StartAt(lowerInclusive)
Signature:lowerInclusive:'K -> Series<'K,'V>
series.VectorBuilder
Signature:IVectorBuilder

Returns the vector builder associated with this series

Static members

Static memberDescription
Series.NullaryGenericOperation(...)
Signature:(series:Series<'K,'T1> * op:('T1 -> 'T2)) -> Series<'K,'T2>
Type parameters: 'K, 'T1, 'T2
Series.NullaryOperation(series, op)
Signature:(series:Series<'K,'T> * op:('T -> 'T)) -> Series<'K,'T>
Type parameters: 'T
Series.ScalarOperationL(...)
Signature:(series:Series<'K,'T> * scalar:'T * op:('T -> 'T -> 'T)) -> Series<'K,'T>
Type parameters: 'T
Series.ScalarOperationR(...)
Signature:(scalar:'T * series:Series<'K,'T> * op:('T -> 'T -> 'T)) -> Series<'K,'T>
Type parameters: 'T
Series.VectorOperation(...)
Signature:(series1:Series<'K,'T> * series2:Series<'K,'T> * op:('T -> 'T -> 'T)) -> Series<'K,'T>
Type parameters: 'T
Fork me on GitHub