MCPcopy Create free account
hub / github.com/javascriptdata/danfojs / constructor

Method constructor

src/danfojs-base/transformers/merge.ts:46–63  ·  view source on GitHub ↗
({left, right, on, how}: mergeParam)

Source from the content-addressed store, hash-verified

44 columns?: ArrayType1D
45
46 constructor({left, right, on, how}: mergeParam) {
47 this.left = left
48 this.right = right
49 this.on = on
50 this.how = how
51
52 //Obtain the column index of the column will
53 //want to merge on for both left and right dataframe
54 for(let i =0; i < this.on.length; i++) {
55 let key = this.on[i]
56 if (this.left.columns.includes(key) && this.right.columns.includes(key)) {
57 let leftIndex = this.left.columns.indexOf(key)
58 let rightIndex = this.right.columns.indexOf(key)
59 this.leftColIndex.push(leftIndex)
60 this.rightColIndex.push(rightIndex)
61 }
62 }
63 }
64
65 /**
66 * Generate key combination base on the columns we want to merge on

Callers

nothing calls this directly

Calls 2

includesMethod · 0.80
indexOfMethod · 0.80

Tested by

no test coverage detected