accept(func(item) bool)
Filters the list by the given function. If the function returns true, the item is accepted, otherwise it is skipped.
append(item)
Returns a new list with the given item appended. If a list is to be created by adding element by element, this method is more efficient than using the '+' operator.
binning(start, size, count, indexFunc, valueFunc)
Returns a map with the binning results. The index function must return the index of the bin for a specific element of the list, and the value function must return the value to be added to the bin. If only the number of times a value was in a bin is to be counted, the value function must return the constant one.
binning2d(startX, sizeX, countX, startY, sizeYX, countY, indexFuncX, indexFuncY, valueFunc)
Returns a map with the binning results.
collectBinning()
Sums up a list of binning results to create a total result.
combine(func(item, item) newItem)
Combines the list by the given function. The function is called for each pair of items in the list and the result is added to the new list. The resulting list is one item shorter than the original list.
combine3(func(item, item, item) newItem)
Combines the list by the given function. The function is called for each triplet of items in the list and the result is added to the new list. The resulting list is two items shorter than the original list.
combineN(n, func([item...]) newItem)
Combines the list by the given function. The function is called for each group of n items in the list and the result is added to the new list. The resulting list is n-1 items shorter than the original list.
compact(func(a, b) value)
Returns a new list with the items compacted. The given function is called for each successive pair of items in the list.If the function returns nil, both values are kept, if not, both values are replaced by the returned value.
createInterpolation(func(item) x, func(item) y)
Returns a function that interpolates between the given points.
cross(other_list, func(a,b) newItem)
Returns a new list with the given function applied to each pair of items in the list and the given list. The function is called with an item from the first list and an item from the second list. The length of the resulting list is the product of the lengths of the two lists.
data(name, unit, func(item) x, func(item) y)
Creates a data set. The two functions are called with the list elements and must return the x respectively y values. If the functions are omitted, the list elements themselves must be lists of the form [x,y]. The last 2 arguments are optional.
eval()
Evaluates the list and stores all items in memory.
first()
Returns the first item in the list.
fsm(func(state, item) state)
Returns a new list with the given function applied to the items in the list. The state is initialized with '{state:0}' and the function is called with the state and the item and returns the new state. See also the function 'goto', which helps to create new state maps.
graph(func(item) x, func(item) y)
Creates a scatter plot content. The two functions are called with the list elements and must return the x respectively y values. If the functions are omitted, the list elements themselves must be lists of the form [x,y]. The arguments are optional.
groupByEqual(func(item) key)
Returns a list of lists grouped by the given function. The function is called for each item in the list and the returned value is used as the key for the group. The result is a list of maps with the keys 'key' and 'values'. The 'key' contains the value returned by the function and 'values' contains a list of items that have the same key. This method relies only on the Equal operator to determine if two keys are equal. This way no hash can be computed, which makes this method much slower than the other groupBy methods, if the list is large (O(n²)).
groupByInt(func(item) int)
Returns a list of lists grouped by the given function. The function is called for each item in the list and the returned integer is used as the key for the group. The result is a list of maps with the keys 'key' and 'values'. The 'key' contains the integer returned by the function and 'values' contains a list of items that have the same key.
groupByString(func(item) string)
Returns a list of lists grouped by the given function. The function is called for each item in the list and the returned string is used as the key for the group. The result is a list of maps with the keys 'key' and 'values'. The 'key' contains the string returned by the function and 'values' contains a list of items that have the same key.
iir(func(first_item) first_new_item, func(item, last_new_item) new_item)
Returns a new list with the given functions applied to the items in the list. The first function is called with the first item in the list and returns the first item in the new list. The second function is called with the remaining items in the list as the first argument, and the last new item. For each subsequent item, the function is called with the item and the result of the previous call.
iirApply(map)
Returns a new list with the given filter applied to the items in the list. Works the same as 'iirCombine' except the required functions are taken from the map, stored in the keys 'initial' and 'filter'.
iirCombine(func(first_item) first_new_item, func(i0, i1, last_new_item) new_item)
Returns a new list with the given functions applied to the items in the list. The first function is called with the first item in the list and returns the first item in the new list. The second function is called with the remaining pairs of items in the list as the first two arguments, and the last new item. For each subsequent item, the function is called with the the pair of items and the result of the previous call. The item i0 is the item in front of i1.
indexWhere(func(item) condition)
Returns the index of the first occurrence of the given function returning true. If this never happens, -1 is returned.
last()
Returns the last item in the list.
linearReg(func(item) x, func(item) y)
Returns a map containing the values a and b of the linear regression function y=a*x+b that fits the data points.
map(func(item) newItem)
Maps the list by the given function. The function is called for each item in the list and the result is added to the new list.
mapReduce(initialSum, func(sum, item) sum)
MapReduce reduces the list to a single value. The initial value is given as the first argument. The function is called with the initial value and the first item, and the result is used as the first argument for the second item and so on.
max()
Returns the maximum value of the list.
mean()
Returns the mean value of the list.
merge(other_list, func(a,b) bool)
Returns a new list with the items of both lists combined. The given function is called for the pair of the first, non processed items in both lists. If the return value is true the value of the original list is taken, otherwise the item from the other list. The is repeated until all items of both lists are processed. If the function returns true if a<b holds and both lists are ordered, also the new list is ordered.
min()
Returns the minimum value of the list.
minMax(func(item) value)
Returns the minimum and maximum value of the list. The function is called for each item in the list and the result is compared to the previous minimum and maximum.
movingWindow(func(item) float)
Returns a list of lists. The inner lists contain all items that are close to each other. Two items are close to each other if the given function returns a similar value for both items. Similarity is defined as the absolute difference being smaller than 1.
movingWindowRemove(func([list of items]) bool)
Returns a list of lists. The given remove-function is called with a sublist of items. At every call a new item from the original list is added to the sublist. If the function returns true the first item of the sublist is removed and the function is called again until it returns false. If the function returns false or if the sublist contains only one item, the sublist is added to the result.
multiUse({name: func(item) newItem...})
MultiUse allows to use the list multiple times without storing or recomputing its elements. The first argument is a map of functions. All the functions are called with the list as argument and the result is returned in a map. The keys in the result map are the same keys used to pass the functions.
number(func(n,item) item)
Returns a list with the given function applied to each item in the list. The function is called with the index of the item and the item itself.
order(func(item) value)
Returns a new list with the items sorted in the order of the values returned by the given function. The function is called for each item in the list and the returned values determine the order.
orderLess(func(a, a) bool)
Returns a new list with the items sorted by the given function. The function is called for pairs of items in the list and the returned bool needs to be true if a<b holds.
orderRev(func(item) value)
Returns a new list with the items sorted in the reverse order of the values returned by the given function. The function is called for each item in the list and the returned values determine the order.
present(func(item) bool)
Returns true if the given function returns true for any item in the list.
reduce(func(item, item) item)
Reduces the list by the given function. The function is called with the first two list items, and the result is used as the first argument for the third item and so on.
replaceList(func(list) newItem)
Replaces the list by the result of the given function. The function is called with the list as argument.
reverse()
Returns the list in reverse order.
set(index, item)
Replaces the item at the given index with the given item. Returns the new list.
single()
Returns the first item in the list.
size()
Returns the number of items in the list.
skip(n)
Returns a list without the first n items.
string()
Returns the list as a string.
sum()
Returns the sum of all items in the list. Shorthand for reduce((a,b)->a+b).
top(n)
Returns the first n items of the list.
uniqueInt(func(item) int)
Returns a list of unique integers returned by the given function.
uniqueString(func(item) string)
Returns a list of unique strings returned by the given function.
visit(initial_visitor, func(visitor, item) visitor)
Visits each item in the list with the given function. The function is called with the visitor and the item. An initial visitor is given as the first argument. The return value of the function is used as the new visitor.