(callable: (value: any) => any, options?: { inplace?: boolean })
| 1048 | */ |
| 1049 | apply(callable: (value: any) => any, options?: { inplace?: boolean }): Series |
| 1050 | apply(callable: (value: any) => any, options?: { inplace?: boolean }): Series | void { |
| 1051 | const { inplace } = { inplace: false, ...options } |
| 1052 | |
| 1053 | const isCallable = utils.isFunction(callable); |
| 1054 | if (!isCallable) { |
| 1055 | throw new Error("Param Error: callable must be a function"); |
| 1056 | } |
| 1057 | |
| 1058 | const data = this.values.map((val) => { |
| 1059 | return callable(val); |
| 1060 | }); |
| 1061 | |
| 1062 | if (inplace) { |
| 1063 | this.$setValues(data) |
| 1064 | } else { |
| 1065 | const sf = this.copy(); |
| 1066 | sf.$setValues(data) |
| 1067 | return sf; |
| 1068 | } |
| 1069 | } |
| 1070 | |
| 1071 | /** |
| 1072 | * Returns a Series with only the unique value(s) in the original Series |
nothing calls this directly
no test coverage detected