* Checks if the array value passed has a compatible dtype, removes NaN values, and if * boolean values are present, converts them to integer values.
(values: ArrayType1D, operation: string)
| 472 | * boolean values are present, converts them to integer values. |
| 473 | */ |
| 474 | private $checkAndCleanValues(values: ArrayType1D, operation: string): number[] { |
| 475 | if (this.dtypes[0] == "string") ErrorThrower.throwStringDtypeOperationError(operation) |
| 476 | values = utils.removeMissingValuesFromArray(values); |
| 477 | |
| 478 | if (this.dtypes[0] == "boolean") { |
| 479 | values = (utils.mapBooleansToIntegers(values as boolean[], 1) as ArrayType1D); |
| 480 | } |
| 481 | return values as number[] |
| 482 | } |
| 483 | |
| 484 | /** |
| 485 | * Returns the mean of elements in Series. |