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

Method replaceNanWithNull

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

* Replace NaN with null before tensor operations * @param arr

(arr: ArrayType1D | ArrayType2D)

Source from the content-addressed store, hash-verified

692 * @param arr
693 */
694 replaceNanWithNull(arr: ArrayType1D | ArrayType2D) {
695 const values = arr.map((val) => {
696 if (isNaN(val as unknown as number)) {
697 return null;
698 } else {
699 return val;
700 }
701 });
702 return values;
703 }
704
705 /**
706 * Get duplicate values in a array

Callers

nothing calls this directly

Calls 1

mapMethod · 0.65

Tested by

no test coverage detected