Loading...

verticapy.vDataFrame.numcol#

vDataFrame.numcol(exclude_columns: str | list[str] | None = None) list#

Returns a list of names of the numerical vDataColumns in the vDataFrame.

Parameters#

exclude_columns: SQLColumns, optional

List of the vDataColumns names to exclude from the final list.

Returns#

List

List of numerical vDataColumns names.

Examples#

We import verticapy:

import verticapy as vp

Hint

By assigning an alias to verticapy, we mitigate the risk of code collisions with other libraries. This precaution is necessary because verticapy uses commonly known function names like “average” and “median”, which can potentially lead to naming conflicts. The use of an alias ensures that the functions from verticapy are used as intended without interfering with functions from other libraries.

Let’s create a small dataset:

data = vp.vDataFrame(
    {
        "empid": ['1', '2', '3', '4'],
        "weight": [140.5, 175, 156.5, 178],
        "height": [168.5, 175, 178.5, 170],
        "emp_cat":[933, 945, 723, 799],
    }
)
data
Abc
empid
Varchar(1)
100%
...
123
weight
Numeric(21)
100%
123
emp_cat
Integer
100%
11...140.5933
22...175.0945
33...156.5723
44...178.0799

Let’s retrieve the numeric type vcolumns in the dataset.

data.numcol()
Out[2]: ['"weight"', '"height"', '"emp_cat"']

See also

vDataFrame.catcol() : Returns all vDataColumns with categorical values.
vDataFrame.datecol() : Returns all vDataColumns with date-type values.
vDataFrame.get_columns() : Returns all vDataColumns.