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

Method checkSeriesOpCompactibility

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

* Checks if two series are compatible for a mathematical operation * @param object * * firstSeries ==> First Series object * * secondSeries ==> Second Series object to comapre with * * operation ==> The mathematical operation

({ firstSeries, secondSeries, operation }: {
        firstSeries: Series, secondSeries: Series, operation: string
    })

Source from the content-addressed store, hash-verified

791 * operation ==> The mathematical operation
792 */
793 checkSeriesOpCompactibility({ firstSeries, secondSeries, operation }: {
794 firstSeries: Series, secondSeries: Series, operation: string
795 }): void {
796
797 if (firstSeries.shape[0] != secondSeries.shape[0]) {
798 ErrorThrower.throwSeriesMathOpLengthError(firstSeries, secondSeries)
799 }
800 if (firstSeries.dtypes[0] == 'string' || secondSeries.dtypes[0] == 'string') {
801 ErrorThrower.throwStringDtypeOperationError(operation)
802 }
803 }
804
805 /**
806 * Custom sort for an array of index and values

Callers 1

_genericMathOpFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected