* 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
})
| 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 |