Loading...

verticapy.core.tablesample.base.TableSample.category#

TableSample.category(column: str) Literal['bool', 'date', 'float', 'int', 'undefined', 'text']#

Returns the category of data in a specified TableSample column.

Parameters#

column: str

TableSample column.

Returns#

Literal

Category of the specified column.

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.

# Example1.
tb.category('name')
Out[4]: 'text'

# Example2.
tb.category('age')
Out[5]: 'int'

See also

TableSample.get_columns() : Returns the TableSample columns.