Deedle


Series<'K, 'V>

Namespace: Deedle

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
Get(key)
Signature: key:'K -> 'V
Get(key, lookup)
Signature: (key:'K * lookup:Lookup) -> 'V
GetAt(index)
Signature: index:int -> 'V
GetByLevel(key)
Signature: key:ICustomLookup<'K> -> Series<'K,'V>
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.
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.
GetKeyAt(index)
Signature: index:int -> 'K
GetObservation(key)
Signature: key:'K -> KeyValuePair<'K,'V>
GetObservation(key, lookup)
Signature: (key:'K * lookup:Lookup) -> KeyValuePair<'K,'V>
GetSlice(lo, hi)
Signature: (lo:'K option * hi:'K option) -> Series<'K,'V>
GetSubrange(lo, hi)
Signature: (lo:('K * BoundaryBehavior) option * hi:('K * BoundaryBehavior) option) -> Series<'K,'V>
[a]
Signature: a:'K -> 'V
[items]
Signature: items:seq<'K> -> Series<'K,'V>
[a]
Signature: a:ICustomLookup<'K> -> Series<'K,'V>
TryGet(key)
Signature: key:'K -> OptionalValue<'V>
TryGet(key, lookup)
Signature: (key:'K * lookup:Lookup) -> OptionalValue<'V>
TryGetAt(index)
Signature: index:int -> OptionalValue<'V>
TryGetObservation(key)
Signature: key:'K -> OptionalValue<KeyValuePair<'K,OptionalValue<'V>>>

Attempts to get a value at the specified 'key'

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

Static members

Static memberDescription
( ? )(series, name)
Signature: (series:Series<string,'?492829> * name:string) -> '?492829

Indexing 

Instance members

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

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.

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

Merging, joining and zipping 

Instance members

Instance memberDescription
Merge(another, behavior)
Signature: (another:Series<'K,'V> * behavior:UnionBehavior) -> Series<'K,'V>
Merge(otherSeries)
Signature: (otherSeries:Series<'K,'V> []) -> Series<'K,'V>
Merge(otherSeries)
Signature: otherSeries:seq<Series<'K,'V>> -> Series<'K,'V>
Merge(otherSeries)
Signature: otherSeries:Series<'K,'V> -> Series<'K,'V>
Zip(otherSeries, kind, lookup)
Signature: (otherSeries:Series<'K,'V2> * kind:JoinKind * lookup:Lookup) -> Series<'K,('V opt * 'V2 opt)>
Zip(otherSeries, kind)
Signature: (otherSeries:Series<'K,'V2> * kind:JoinKind) -> Series<'K,('V opt * 'V2 opt)>
Zip(otherSeries)
Signature: otherSeries:Series<'K,'V2> -> Series<'K,('V opt * 'V2 opt)>
ZipInner(otherSeries)
Signature: otherSeries:Series<'K,'V2> -> Series<'K,('V * 'V2)>

Operators 

Static members

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

Projection and filtering 

Instance members

Instance memberDescription
Convert(forward, backward)
Signature: (forward:Func<'V,'R> * backward:Func<'R,'V>) -> Series<'K,'R>
Reversed
Signature: Series<'K,'V>
ScanAllValues(foldFunc, init)
Signature: (foldFunc:Func<OptionalValue<'S>,OptionalValue<'V>,OptionalValue<'S>> * init:OptionalValue<'S>) -> Series<'K,'S>
ScanValues(foldFunc, init)
Signature: (foldFunc:Func<'S,'V,'S> * init:'S) -> Series<'K,'S>
Select(f)
Signature: f:Func<KeyValuePair<'K,'V>,'R> -> Series<'K,'R>
Select(f)
Signature: f:Func<KeyValuePair<'K,'V>,int,'R> -> Series<'K,'R>
SelectKeys(f)
Signature: f:Func<KeyValuePair<'K,OptionalValue<'V>>,'R> -> Series<'R,'V>
SelectOptional(f)
Signature: f:Func<KeyValuePair<'K,OptionalValue<'V>>,OptionalValue<'R>> -> Series<'K,'R>
SelectValues(f)
Signature: f:Func<'V,'T> -> Series<'K,'T>
Where(f)
Signature: f:Func<KeyValuePair<'K,'V>,bool> -> Series<'K,'V>
Where(f)
Signature: f:Func<KeyValuePair<'K,'V>,int,bool> -> Series<'K,'V>
WhereOptional(f)
Signature: f:Func<KeyValuePair<'K,OptionalValue<'V>>,bool> -> Series<'K,'V>
WithMissingFrom(otherSeries)
Signature: otherSeries:Series<'K,'?492881> -> Series<'K,'V>

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.

Resampling 

Instance members

Instance memberDescription
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.

Resample(keys, direction, valueSelector)
Signature: (keys:seq<'K> * direction:Direction * valueSelector:Func<'K,Series<'K,'V>,'?492922>) -> Series<'K,'?492922>

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.

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

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

IsEmpty
Signature: bool
IsOrdered
Signature: bool
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.

KeyRange
Signature: 'K * 'K
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.

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.

ObservationsAll
Signature: seq<KeyValuePair<'K,OptionalValue<'V>>>

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

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

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.

ValuesAll
Signature: seq<'V>

Returns a collection of values, including possibly missing values. Note that the length of this sequence matches the Keys sequence.

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

Groups a series (ordered or unordered) using the specified key selector (keySelector)

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.
Interpolate(keys, f)
Signature: (keys:seq<'K> * f:Func<'K,OptionalValue<KeyValuePair<'K,'V>>,OptionalValue<KeyValuePair<'K,'V>>,'V>) -> 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.

Parameters

  • keys - Sequence of new keys that forms the index of interpolated results
  • f - Function to do the interpolating
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

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

Full name: docs.input
val res : obj

Full name: docs.res
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

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

Full name: docs.input
val res : obj

Full name: docs.res

Other type members 

Constructors

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

Instance members

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

Shows the series content in a human-readable format. The resulting string shows a limited number of values from the series.

Parameters

  • startCount - The number of elements to show at the beginning of the series
  • endCount - The number of elements to show at the end of the series
Format(itemCount)
Signature: itemCount:int -> string

Shows the series content in a human-readable format. The resulting string shows a limited number of values from the series.

Parameters

  • itemCount - The total number of items to show. The result will show at most itemCount/2 items at the beginning and ending of the series.
Format()
Signature: unit -> string

Shows the series content in a human-readable format. The resulting string shows a limited number of values from the series.

GetAddressRange(range)
Signature: range:RangeRestriction<Address> -> Series<'K,'V>

Internal helper used by skip, take, etc.

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

Static members

Static memberDescription
( $ )(f, series)
Signature: (f:('V -> '?492866) * series:Series<'K,'V>) -> Series<'K,'?492866>

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:

1: 
2: 
3: 
4: 
5: 
6: 
// 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)
val s1 : obj

Full name: docs.s1
val adjust : v:float -> float

Full name: docs.adjust
val v : float
val max : e1:'T -> e2:'T -> 'T (requires comparison)

Full name: Microsoft.FSharp.Core.Operators.max
Fork me on GitHub