Loading...

vastorbit.VastFrame.numcol

VastFrame.numcol(exclude_columns: Annotated[str | list[str], 'STRING representing one column or a list of columns'] | None = None) list

Returns a list of names of the numerical VastColumns in the VastFrame.

Parameters:

exclude_columns (SQLColumns, optional) – List of the VastColumns names to exclude from the final list.

Returns:

List of numerical VastColumns names.

Return type:

List

Examples

We import vastorbit:

import vastorbit as vo

Hint

By assigning an alias to vastorbit, we mitigate the risk of code collisions with other libraries. This precaution is necessary because vastorbit 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 vastorbit are used as intended without interfering with functions from other libraries.

Let’s create a small dataset:

data = vo.VastFrame(
    {
        "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)
123
weight
Decimal(11, 1)
123
height
Decimal(11, 1)
123
emp_cat
Integer
11140.5168.5933
22175.0175.0945
33156.5178.5723
44178.0170.0799
Rows: 1-4 | Columns: 4

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

data.numcol()

See also

VastFrame.catcol() : Returns all VastColumns with categorical values.
VastFrame.datecol() : Returns all VastColumns with date-type values.
VastFrame.get_columns() : Returns all VastColumns.