Loading...

vastorbit.core.tablesample.base.TableSample.transpose

TableSample.transpose() TableSample

Transposes the TableSample.

Returns:

transposed TableSample.

Return type:

TableSample

Examples

Let’s import the TableSample object:

from vastorbit import TableSample

Let’s build an example object.

# dict with all the data.
d = {
    "customer_ID": [0, 1, 2, 3],
    "age": [40, 30, 22, 55],
    "name": ['Roger', 'Maria', 'Alisia', 'Costi'],
}

# creating the object.
tb = TableSample(d)
customer_IDagename
1040Roger
2130Maria
3222Alisia
4355Costi
Rows: 1-4 | Columns: 3

Let’s use the function.

tb.transpose()
customer_ID0123
1age40302255
2nameRogerMariaAlisiaCosti
Rows: 1-2 | Columns: 5

Warning

This will modify the main object, and the input TableSample will be appended to it.

See also

TableSample.narrow() : Returns the narrow representation of the TableSample.