MCPcopy Index your code
hub / github.com/javascriptdata/danfojs / loadArrayIntoNdframe

Method loadArrayIntoNdframe

src/danfojs-base/core/generic.ts:109–120  ·  view source on GitHub ↗

* Internal function to load array of data into NDFrame * @param data The array of data to load into NDFrame * @param index Array of numeric or string names for subsetting array. * @param columns Array of column names. * @param dtypes Array of data types for each the column.

({ data, index, columns, dtypes }: LoadArrayDataType)

Source from the content-addressed store, hash-verified

107 * @param dtypes Array of data types for each the column.
108 */
109 private loadArrayIntoNdframe({ data, index, columns, dtypes }: LoadArrayDataType): void {
110 // this.$data = utils.replaceUndefinedWithNaN(data, this.$isSeries);
111 this.$data = data
112 if (!this.$config.isLowMemoryMode) {
113 //In NOT low memory mode, we transpose the array and save in column format.
114 //This makes column data retrieval run in constant time
115 this.$dataIncolumnFormat = utils.transposeArray(data)
116 }
117 this.$setIndex(index);
118 this.$setDtypes(dtypes);
119 this.$setColumnNames(columns);
120 }
121
122 /**
123 * Internal function to format and load a Javascript object or object of arrays into NDFrame.

Callers 2

constructorMethod · 0.95
loadObjectIntoNdframeMethod · 0.95

Calls 4

$setIndexMethod · 0.95
$setDtypesMethod · 0.95
$setColumnNamesMethod · 0.95
transposeArrayMethod · 0.80

Tested by

no test coverage detected