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

Method add

src/danfojs-base/core/frame.ts:612–625  ·  view source on GitHub ↗
(other: DataFrame | Series | number[] | number, options?: { axis?: 0 | 1, inplace?: boolean })

Source from the content-addressed store, hash-verified

610 */
611 add(other: DataFrame | Series | number[] | number, options?: { axis?: 0 | 1, inplace?: boolean }): DataFrame
612 add(other: DataFrame | Series | number[] | number, options?: { axis?: 0 | 1, inplace?: boolean }): DataFrame | void {
613 const { inplace, axis } = { inplace: false, axis: 1, ...options }
614
615 if (this.$frameIsNotCompactibleForArithmeticOperation()) {
616 throw Error("TypeError: add operation is not supported for string dtypes");
617 }
618
619 if ([0, 1].indexOf(axis) === -1) {
620 throw Error("ParamError: Axis must be 0 or 1");
621 }
622
623 const tensors = this.$getTensorsForArithmeticOperationByAxis(other, axis);
624 return this.$MathOps(tensors, "add", inplace)
625 }
626
627 /**
628 * Return substraction between DataFrame and other.

Callers

nothing calls this directly

Tested by

no test coverage detected