(options?: { inplace?: boolean })
| 1150 | */ |
| 1151 | abs(options?: { inplace?: boolean }): Series |
| 1152 | abs(options?: { inplace?: boolean }): Series | void { |
| 1153 | const { inplace } = { inplace: false, ...options } |
| 1154 | |
| 1155 | if (this.dtypes[0] == "string") ErrorThrower.throwStringDtypeOperationError("abs") |
| 1156 | let newValues; |
| 1157 | |
| 1158 | |
| 1159 | newValues = this.values.map(val => Math.abs(val as number)); |
| 1160 | |
| 1161 | if (inplace) { |
| 1162 | this.$setValues(newValues as ArrayType1D) |
| 1163 | } else { |
| 1164 | const sf = this.copy(); |
| 1165 | sf.$setValues(newValues as ArrayType1D) |
| 1166 | return sf; |
| 1167 | } |
| 1168 | } |
| 1169 | |
| 1170 | /** |
| 1171 | * Returns the cumulative sum over a Series |
nothing calls this directly
no test coverage detected