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

Method is1DArray

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

* Checks if array is 1D * @param arr The array

(arr: ArrayType1D | ArrayType2D)

Source from the content-addressed store, hash-verified

367 * @param arr The array
368 */
369 is1DArray(arr: ArrayType1D | ArrayType2D): boolean {
370 if (
371 typeof arr[0] == "number" ||
372 typeof arr[0] == "string" ||
373 typeof arr[0] == "boolean" ||
374 arr[0] === null
375 ) {
376 return true;
377 } else {
378 return false;
379 }
380 }
381
382 /**
383 * Converts an array to an object using array index as object keys

Callers 8

inferDtypeMethod · 0.95
applyMethod · 0.80
appendMethod · 0.80
constructorMethod · 0.80
$getDataMethod · 0.80
$getDataMethod · 0.80
$getTensorMethod · 0.80
$getTensorMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected