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

Method mod

src/danfojs-base/core/series.ts:456–468  ·  view source on GitHub ↗
(other: Series | number | Array<number>, options?: { inplace?: boolean })

Source from the content-addressed store, hash-verified

454 */
455 mod(other: Series | number | Array<number>, options?: { inplace?: boolean }): Series
456 mod(other: Series | number | Array<number>, options?: { inplace?: boolean }): Series | void {
457 const { inplace } = { inplace: false, ...options }
458
459 if (this.dtypes[0] == "string") ErrorThrower.throwStringDtypeOperationError("mod")
460
461 const newData = _genericMathOp({ ndFrame: this, other, operation: "mod" })
462
463 if (inplace) {
464 this.$setValues(newData as ArrayType1D)
465 } else {
466 return utils.createNdframeFromNewDataWithOldProps({ ndFrame: this, newData, isSeries: true }) as Series
467 }
468 }
469
470 /**
471 * Checks if the array value passed has a compatible dtype, removes NaN values, and if

Callers

nothing calls this directly

Calls 3

_genericMathOpFunction · 0.90
$setValuesMethod · 0.80

Tested by

no test coverage detected