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

Method convertArrayToObject

src/danfojs-base/shared/utils.ts:386–393  ·  view source on GitHub ↗

* Converts an array to an object using array index as object keys * @param arr The array

(arr: ArrayType1D | ArrayType2D)

Source from the content-addressed store, hash-verified

384 * @param arr The array
385 */
386 convertArrayToObject(arr: ArrayType1D | ArrayType2D) {
387 const arrObj: any = {};
388 for (let i = 0; i < arr.length; i++) {
389 arrObj[i] = arr[i];
390
391 }
392 return arrObj;
393 }
394
395 /**
396 * Count the NaN and non-NaN values present in an array

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected