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

Method sub

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

Source from the content-addressed store, hash-verified

644 */
645 sub(other: DataFrame | Series | number[] | number, options?: { axis?: 0 | 1, inplace?: boolean }): DataFrame
646 sub(other: DataFrame | Series | number[] | number, options?: { axis?: 0 | 1, inplace?: boolean }): DataFrame | void {
647 const { inplace, axis } = { inplace: false, axis: 1, ...options }
648
649 if (this.$frameIsNotCompactibleForArithmeticOperation()) {
650 throw Error("TypeError: sub operation is not supported for string dtypes");
651 }
652
653 if ([0, 1].indexOf(axis) === -1) {
654 throw Error("ParamError: Axis must be 0 or 1");
655 }
656
657 const tensors = this.$getTensorsForArithmeticOperationByAxis(other, axis);
658 return this.$MathOps(tensors, "sub", inplace)
659
660
661 }
662 /**
663 * Return multiplciation between DataFrame and other.
664 * @param other DataFrame, Series, Array or Scalar number to multiply with.

Callers

nothing calls this directly

Tested by

no test coverage detected