Array
Namespace: Deedle.Internal
This module contains additional functions for working with arrays.
Deedle.Internals
is opened, it extends the standard Array
module.
Functions and values
Function or value | Description |
binarySearchNearestGreater(...)
Signature: key:'T -> comparer:IComparer<'T> -> inclusive:bool -> array:ReadOnlyCollection<'T> -> int option
Type parameters: 'T
|
Returns the index of 'key' or the index of immediately following value.
If the specified key is greater than all keys in the array, None is returned.
When 'inclusive' is false, the function returns the index of strictry greater value.
Note that the function expects that the array contains distinct values
(which is fine because LinearIndex does not support duplicate keys)
|
binarySearchNearestSmaller(...)
Signature: key:'T -> comparer:IComparer<'T> -> inclusive:bool -> array:ReadOnlyCollection<'T> -> int option
Type parameters: 'T
|
Returns the index of 'key' or the index of immediately preceeding value.
If the specified key is smaller than all keys in the array, None is returned.
When 'inclusive' is false, the function returns the index of strictry smaller value.
Note that the function expects that the array contains distinct values
(which is fine because LinearIndex does not support duplicate keys)
|
choosei f array
Signature: f:(int -> 'a -> 'b option) -> array:'a [] -> 'b []
Type parameters: 'a, 'b
|
Returns a new array containing only the elements for which the specified function returns Some .
The predicate is called with the index in the source array and the element.
|
dropRange first last data
Signature: first:int -> last:int -> data:'T [] -> 'T []
Type parameters: 'T
|
Drop a specified range from a given array. The operation is inclusive on
both sides. Given [ 1; 2; 3; 4 ] and indices (1, 2), the result is [ 1; 4 ]
|