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

Method eq

src/danfojs-base/core/frame.ts:1169–1182  ·  view source on GitHub ↗

* Returns "equals to" of dataframe and other. * @param other DataFrame, Series, Array or Scalar number to compare with * @param options.axis 0 or 1. If 0, add column-wise, if 1, add row-wise * @example * ``` * const df = new DataFrame([[1, 2], [3, 4]], { columns: ['A', 'B']}

(other: DataFrame | Series | number | Array<number>, options?: { axis?: 0 | 1 })

Source from the content-addressed store, hash-verified

1167 * ```
1168 */
1169 eq(other: DataFrame | Series | number | Array<number>, options?: { axis?: 0 | 1 }): DataFrame {
1170 const { axis } = { axis: 1, ...options }
1171
1172 if (this.$frameIsNotCompactibleForArithmeticOperation()) {
1173 throw Error("TypeError: eq operation is not supported for string dtypes");
1174 }
1175
1176 if ([0, 1].indexOf(axis) === -1) {
1177 throw Error("ParamError: Axis must be 0 or 1");
1178 }
1179
1180 const tensors = this.$getTensorsForArithmeticOperationByAxis(other, axis);
1181 return this.$logicalOps(tensors, "eq")
1182 }
1183
1184 /**
1185 * Returns "not equal to" of dataframe and other.

Callers

nothing calls this directly

Tested by

no test coverage detected