(options?: { inplace?: boolean })
| 2685 | **/ |
| 2686 | transpose(options?: { inplace?: boolean }): DataFrame |
| 2687 | transpose(options?: { inplace?: boolean }): DataFrame | void { |
| 2688 | const { inplace } = { inplace: false, ...options } |
| 2689 | const newData = utils.transposeArray(this.values) |
| 2690 | const newColNames = [...this.index.map(i => i.toString())] |
| 2691 | |
| 2692 | if (inplace) { |
| 2693 | this.$setValues(newData, false, false) |
| 2694 | this.$setIndex([...this.columns]) |
| 2695 | this.$setColumnNames(newColNames) |
| 2696 | } else { |
| 2697 | return new DataFrame(newData, { |
| 2698 | index: [...this.columns], |
| 2699 | columns: newColNames, |
| 2700 | config: { ...this.config } |
| 2701 | }) |
| 2702 | } |
| 2703 | } |
| 2704 | |
| 2705 | /** |
| 2706 | * Returns the Transpose of the DataFrame. Similar to `transpose`. |
nothing calls this directly
no test coverage detected