References
array
summary | ||
public |
F arrCMP(arr1: [sorted_elements], arr2: [sorted_elements]): integer Compare array, assumes the arry is sorted returns -1, 0, +1 as required by a sotring compare function |
|
public |
Tests array for equality |
|
public |
Use with a reducer |
|
public |
F flatten(arr: [with_inner_arra], level: integer): [type] Flatten an array to a depth of level, for example if level = 1, only flatten at the top level (depath1) |
|
public |
F arrProd(list: [type]): [type] array cross product in n dimension, where n ils the number of arguments (length of list) Note: this can produce enormous amounts of data for n > 1, for esample n = 2, list[0].length = x ,and list[1].length = y the resultant array contains x*y values, x = 100, y=200 we produce 20,000 values; |
|
public |
F reord(subListWithNewOrder: [type], fullList: [type]): [type] |
|
private |
|
|
public |
V reord |
array/arrayutils
summary | ||
public |
concatinate a list of arrays |
|
public |
F arrCountVal(list: [type], v: [type]): [type] [arrCountVal description] |
|
public |
THis decorates and array function so that it can have one of two forms 1. |
|
public |
return the difference of two arrays same as arr1 xor arr2 |
|
public |
F arrDistinct(arr1: [type], arr2: [type]): [type] arrDistinct description, not array equal |
|
public |
F arrHash() |
|
public |
F arrIntersect(arr1: Array, arr2: Array): Array return the intersection of two arrays |
|
public |
create an array of same values (aVal) where the result has n of those values |
|
public |
array subtraction arr - listToRemove (return an array with all elements of arr this is not in listToRemove) |
|
public |
split an array into n more or less equal length arrays |
|
public |
return the union of two arrays |
|
public |
zip and array, given an array of columns (each element is a column of values) converts and array of column arrays to and array row arrays |
|
public |
filter an attar and return the index found |
|
public |
Get the last element of an array |
|
public |
create a new array of length n |
|
public |
|
|
public |
[safeDedup description] |
|
public |
F setHash(arrOfInt: [int]): [type] function to take the hash of an array of integers |
|
public |
F vecAdd(a1: [number], a2: [number]): [number] Add two vectors |
|
public |
F xor(array1: [type], array2: [type]): [type] remove all elements that are in both arrays |
|
public |
F dictToZip() |
|
public |
F dictToZipB() |
|
public |
F zipToDict(aListOfPairs: [[string, any]]): [type] |
|
public |
|
|
public |
V arrCount |
|
public |
V arrCurry |
|
public |
V arrDedup |
|
public |
V arrDiff |
|
public |
V arrHash |
|
public |
|
|
public |
V arrMax |
|
public |
V arrMean |
|
public |
V arrMin |
|
public |
V arrOf |
|
public |
|
|
public |
V arrSplit |
|
public |
V arrSum |
|
public |
V arrUnion |
|
public |
V arrZip |
|
public |
V last |
|
public |
V newArray |
|
public |
V redim |
|
public |
|
|
public |
V vecAdd |
|
public |
V xor |
array/intset
summary | ||
public |
F asSortedSet(array: [type]): [type] converts an array to sorted set, pure function - does not modify the input |
|
public |
F dedupSortedArr(arr: [Array]): [Array] removes all duplicates in a sorted array, pure function - does not modify the input |
|
public |
F findIndexOf(aSet: [Array], searchElement: [Any]): [Int] find the index of an element is a sorted array representing a set, uses binary search |
|
public |
F hasNoDups(arr: [Array]): [Boolean] checks if sorted array has no dups, pure function - does not modify the input |
|
public |
F intersect(sortedL: [Array]]): [Array] intersection of a list of sets (sorted arrays) Intersects list sorted array sets (array that issorted and has no duplicates) |
|
public |
F intersectL(lsa: [Array]): [Array] intersection of an Array of sets, where each Set is represented as a sorted array of values (no dups) |
|
public |
F isSorted(arr: [type]): [boolean] checks if array is sorted, pure function - does not modify the input |
|
public |
F max(list: [any]): any maximum of a sorted array |
|
public |
F range(start: [int32], end: [int32]): [Array] Creates a set (array) of numbers [start ... |
|
public |
F similarity(sortedA: [Array], sortedB: [Array]): [Array] Show how similar two sets (sorted list) actually are |
|
public |
F subtract(fromSet: [Array], elementsToRemove: [Array]): [Array] Set subtraction: fromSet - elementsToRemove, assumes both sets are are represented by sorted array, and as per set definition there are no dups |
|
public |
F unionL(lsa: [Array]): [set] Union of a list of sets: assumes both sets are are represented by sorted array, and as per set definition there are no dups |
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
V isSorted |
|
public |
V max |
|
public |
V range |
|
public |
|
|
public |
V subtract |
|
public |
V unionL |
dict
summary | ||
private |
V __DICT__ |
dict/utils
summary | ||
public |
C Accum |
|
public |
Support one => many mapping |
|
public |
|
|
public |
C SumDict Dictionary to count the number of key value pairs, Note for any key we only support one value, if |
|
public |
F groupByToDict(aFrame: [type], colName: [type], cmp: [type], mapFn: [type]): [type] Returns an array of Frames, for each group the name of the Frameis the value of the grouping |
|
public |
F groupToDict(aFrame: [type], colName: [type], cmp: [type], mapFn: [type]): [type] [groupToDict description] |
|
public |
F zipTo() |
|
public |
|
|
public |
|
|
public |
V zipTo |
frame
summary | ||
public |
Used to from the base class for a Frame, This is added to break circular import reference from hasFrame(aFrame) function Originally hasFrame imported frame and frame imported hasFrame. |
|
public |
C Frame This pure data structure represent a database like table internally it consists of rows and columns representing a generalized 2d matrix You can also think of this like a limited excel sheet. |
|
public |
F arrToCol(arr: [type]): [type] [arrToCol description] |
|
public |
F createAccesClass(columns: [type]): [type] [createAccesClass description] |
|
public |
F genColIxFunc(aFrame: [type]): [type] [genColIxFunc description] |
|
public |
F getColIx() |
|
public |
F groupBy(groupColsOrig: [type], aFrame: [type], accumList: [type]): [type] The frame should already be sorted by the groupBy order, or |
|
public |
F haveFrame() |
|
private |
F _makeUnique(listOfRows: [column_elements], colIx: [type]): dict |
|
public |
F arrayUniq(list: [type]): [type] [description] |
|
public |
F sortFrameBy(columnNames: [type], aFrame: [type], cmpFn: [type]): [type] create a comparison function for a frame usage sortFrameBy(['+surname', 'givenName', '-age'], aFrame)
|
|
public |
F toHTML() |
|
private |
|
|
public |
V arrToCol |
|
public |
|
frame/frame-utils
summary | ||
public |
F coreFrameFromBuffer(buffer: string, splitter: function, options: {noConvert: boolen, name: string, Fr: SomeFrameClass}): Frame Create a Frame from a string buffer (string reat from a file)
|
|
public |
F frameCount(aFrame: Frme, colName: string, convName: function): [string, number] [frameCount description] |
|
public |
F frameFromBuffer(buffer: string, splitter: function, options: {noConvert: boolen, name: string, Fr: SomeFrameClass}): Frame Create a Frame from a string buffer (string reat from a file)
|
|
public |
[frameSum description] |
|
public |
F frameToString(aFrame: [type]): [type] [frameToString description] |
|
public |
F frameWithIndex(aFrame: Frame, indexName: string, atEnd: boolean): Frame [frameWithIndex description] |
|
public |
F transpose(frame: [type], pivot: [type]): [type] [transpose description] |
|
public |
F unionFrame(frame1: Frame, frame2: Frame, notSorted: boolean): Frame Creates a new frame from the union of the rows of the two frames, similar to s set union. |
|
public |
|
|
public |
|
|
public |
|
|
public |
V frameSum |
|
public |
|
|
public |
|
|
public |
|
|
public |
|
frame/groupby-utils
summary | ||
public |
F accStr() |
|
public |
F gbCount(name: [type], newName: [type]): [type] gbCount count elemnts (non empty) in a group, bases on sql group by operation |
|
public |
gbMax max value in a group, see gbMin |
|
public |
gbMean average (mean) value of a group - see gbMin |
|
public |
F gbMerge(name: [type], newName: [type], sep: [type]): [type] gbMerge merge the values grouped rows onto a single comma seperated value |
|
public |
F gbMergeU(name: [type], newName: [type], sep: [type]): [type] [gbMergeU description] |
|
public |
gbMin minimum elemnts value (non empty) in a group, bases on sql group by operation |
|
public |
F gbStdDiv(name: [type], newName: [type]): [type] gbStdDiv standard deviation - see gbMin |
|
public |
F gbSum(name: [type], newName: [type]): [type] gbSum sum eelemnts in a group, bases on sql group by operation |
|
public |
F gbVal(newName: [type], value: [type]): [type] create a column with constant value |
|
public |
V accStr |
|
public |
V gb |
|
public |
V gbCount |
|
public |
V gbMax |
|
public |
V gbMean |
|
public |
V gbMerge |
|
public |
V gbMergeU |
|
public |
V gbMin |
|
public |
V gbStdDiv |
|
public |
V gbSum |
|
public |
V gbVal |
frame/join-utils
summary | ||
public |
F changeNameTo(name: string, sep: string): [oldName, newName] changeNameTo takes a change name description array of two elements containing the old names and the new names e.g oldName=newName 'a name change descriptor' where '=' is the seperator return an array of 2 strings [oldName, newName] |
|
public |
F colName(list: [string], colsNameList1: [string], colsNameList2: [string]): [[string],[string]] colName(['1.DX=DX1', '2.DX=DX2', '1.FX=F1', ...], ['DX','FX',...],['DX',...]) |
|
public |
F fullInnerJoin(frame1: Frame, frame2: Frame, projectList: [string], joinOn: string, filter: function): Frame
|
|
public |
F getDict() |
|
public |
F getTransform(projectList: [string], cols1: [string], cols2: [string]): Object Takes two column list (or one) and a mapping list and returns a transform function That will create a new row taking columns from each of the lists |
|
public |
F indexFrameColumn(aFrame: Frame, colName: String, noNull: boolean, dict: Object): Dict Creates a index for a column (dictionary) |
|
public |
F innerJoin(frame1: Frame, frame2: Frame, projectList: Array<string>, joinOn: String, filter: function): Frame innerJoin works like an SQL inner join, not quite as flexible, select a as A, b, frame1.x from frame1, frame2 where frame1.colName1 = frame2.colName2 and {filter} |
|
public |
returns a function that will perform an innet joint test |
|
public |
F leftJoin(frame1: Frame, frame2: Frame, projectList: Array<string>, joinOn: String, filter: function): Frame leftJoin works like an SQL inner join, not quite as flexible, select a as A, b, frame1.x from frame1, frame2 where frame1.colName1 = frame2.colName2 and {filter} |
|
public |
F localGroupBy() |
|
public |
F matchIt(res: [type], row1: [type], arr: [type], cmp: [type], tr: [type]): [[row_element] leftJoin on one row from left and arr from right |
|
public |
F outerJoin(frame1: [type], frame2: [type], projectList: [type], joinOn: [type], filter: [type]): [type] [outerJoin description] |
|
public |
F project() |
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
V colName |
|
public |
|
|
public |
V getDict |
|
public |
|
|
public |
|
|
public |
V joinOp |
|
public |
|
|
public |
V matchIt |
|
public |
V project |
string
summary | ||
private |
|
string/csv
summary | ||
public |
converts a line representing comma separated values (CSV) into an array of strings |
|
public |
Takes a array of string lines, representing a list of 'row' strings. |
|
public |
converts a line representing pipe (|) separated values (PSV) into an array of strings. |
|
public |
F trimListElements(arr: [string]): [string] Takes an array of strings and trims all the strings in the array, modifies the input array and returns the same array with the trimed strings |
|
public |
converts a line representing tab separated values (TSV) into an array of strings |
|
public |
V csvLine |
|
public |
|
|
public |
V psvLine |
|
public |
|
|
public |
V tsvLine |
string/strdict
summary | ||
public |
C StrDict String Dictionary implememtation that minimizes the garbage created |
|
public |
strEq str.substring(strStart,strEnd) === otherStr |
|
public |
Code taken from https://github.com/darkskyapp/string-hash, Too small to be worth is own module. |
|
public |
V strEq |
|
public |
V strHash |
string/strutil
summary | ||
public |
count the number of occurences of char in the string |
|
public |
Create a FUNCTION resturns padded (default is '0') string rep of a number |
|
public |
F prefixHead(a: string, b: string): string gets the prefix string of 'a' and 'n', for example a = 'asset', b = 'assess', the return will be 'asse' |
|
public |
Find the length of the longest prefix of a and b string if a = pre + a1 and b = pre + b1 pre is the longet sting that satisfies the relationship i.e. |
|
public |
F prefixTail(a: String, b: String): [string] Gets the non-prefix string of 'a' and 'n', for example a = 'asset', b = 'assess', the return will be ['t', 'ss'] |
|
public |
This is rthe cross product of two arrays, where each arrys is an array of strings the result is and array of length m x n, where m is the length of the first vector and n is the length of the second vector |
|
public |
reverse a string |
|
public |
join an array of strings ignoring empty values |
|
public |
V countCh |
|
public |
V padTo |
|
public |
|
|
public |
|
|
public |
|
|
public |
V prod |
|
public |
V reverse |
|
public |
V strJoin |
utils
summary | ||
public |
F AND() |
|
public |
F FALSE() |
|
public |
F NOT() |
|
public |
F OR() |
|
public |
F TRUE() |
|
public |
F primeAround() |
|
public |
F renameColumns() |
|
public |
|
|
public |
|
|
public |
V K |
|
public |
|
|
public |
|
|
public |
V ZERO_STR |
|
private |
|
|
public |
|
utils/objutils
summary | ||
public |
F filterDict(aDict: object, listOrFunc: [type]): Object |
|
public |
F fromKeyValueList(list: [type]): [type] [fromKeyValueList description] |
|
public |
F fromKeyValueListV(list: [type]): [type] [fromKeyValueListV description] |
|
public |
F genFilterFunction(aListOrStringOrEmpty: [string]): [type] create a function that tests for elements in aListOrStringOrEmpty aListOrStringOrEmpty => undefined - allows everything aListOrStringOrEmpty => [... |
|
public |
F genObjMapper(obj: [type]): [mapperFunction, [keys]] genObjMapper generates a function to map object to an array this is useful to convert an array of object to the data of a frame |
|
public |
F keys() |
|
public |
Memoize a function (see https://en.wikipedia.org/wiki/Memoization) |
|
public |
Same as the |
|
public |
Set the vale of a key on an object and return the object |
|
public |
F setKeyV(obj: [type], key: [type], v: [type]) setKeyV - set object's key (multiple) value, if there is no value argument is present get the value list for the key |
|
public |
F shallow() |
|
public |
F toKeyValueList(obj: [type]): [type] [toKeyValueList description] |
|
public |
F toKeyValueListV(obj: [type]): [type] [toKeyValueListV description] |
|
public |
V access |
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
V keys |
|
public |
V mapOver |
|
public |
V memoize |
|
public |
V pick |
|
public |
V pickRaw |
|
public |
V setKey |
|
public |
V setKeyV |
|
public |
V shallow |
|
public |
|
|
public |
|
|
public |
V isA |
utils/sort-helper
summary | ||
public |
F cmpNumOrStrBy(colIX: [type]): function comapre string or number (used to sort frames) |
|
public |
Compare two strings (for sorting) 0 == euqal, -1 a<b, 1 a>b |
|
public |
cmpStrNum compare (number, number), or (number, string-of-number) or (string-of-number, number) (string-of-number, string-of-number) , (string, string) |
|
public |
F combineCmp(funcs: ...[type]): [type] combine a set of sorting comparison functions so tht the sort presidence is maintained |
|
public |
Reverses a sort compare function so it sorts in descending order |
|
public |
F toNumber(str: [type]): [type] Convert a string to a Javascript number, thakes into accont number string with commas (,) and numbers |
|
public |
|
|
public |
|
|
public |
V revCmp |