(callable: any, options?: { inplace?: boolean })
| 2589 | */ |
| 2590 | applyMap(callable: any, options?: { inplace?: boolean }): DataFrame |
| 2591 | applyMap(callable: any, options?: { inplace?: boolean }): DataFrame | void { |
| 2592 | const { inplace } = { inplace: false, ...options } |
| 2593 | |
| 2594 | const newData = (this.values as ArrayType2D).map((row) => { |
| 2595 | const tempData = row.map((val) => { |
| 2596 | return callable(val); |
| 2597 | }); |
| 2598 | return tempData; |
| 2599 | }); |
| 2600 | |
| 2601 | if (inplace) { |
| 2602 | this.$setValues(newData); |
| 2603 | } else { |
| 2604 | return new DataFrame(newData, |
| 2605 | { |
| 2606 | index: [...this.index], |
| 2607 | columns: [...this.columns], |
| 2608 | dtypes: [...this.dtypes], |
| 2609 | config: { ...this.config } |
| 2610 | }); |
| 2611 | } |
| 2612 | } |
| 2613 | |
| 2614 | /** |
| 2615 | * Returns the specified column data as a Series object. |
nothing calls this directly
no test coverage detected