MCPcopy Index your code
hub / github.com/javascriptdata/danfojs / T

Method T

src/danfojs-base/core/frame.ts:2714–2721  ·  view source on GitHub ↗

* Returns the Transpose of the DataFrame. Similar to `transpose`. * @example * ``` * const df = new DataFrame([[1, 2], [3, 4]], { columns: ['A', 'B']}) * const df2 = df.T() * df2.print() * ```

()

Source from the content-addressed store, hash-verified

2712 * ```
2713 **/
2714 get T(): DataFrame {
2715 const newData = utils.transposeArray(this.values)
2716 return new DataFrame(newData, {
2717 index: [...this.columns],
2718 columns: [...this.index.map(i => i.toString())],
2719 config: { ...this.config }
2720 })
2721 }
2722
2723 /**
2724 * Replace all occurence of a value with a new value.

Callers

nothing calls this directly

Calls 3

transposeArrayMethod · 0.80
mapMethod · 0.65
toStringMethod · 0.65

Tested by

no test coverage detected