Loading...

verticapy.core.tablesample.base.TableSample.to_list#

TableSample.to_list() list#

Converts the TableSample to a list.

Returns#

list

Python list.

Examples#

Let’s import the TableSample object:

from verticapy 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_ID
age
name
1040Roger
2130Maria
3222Alisia
4355Costi
Rows: 1-4 | Columns: 3

Let’s use the function.

tb.to_list()
Out[4]: [[0, 40, 'Roger'], [1, 30, 'Maria'], [2, 22, 'Alisia'], [3, 55, 'Costi']]

See also

TableSample.to_numpy() : Converts the TableSample to a numpy.array.