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 fromverticapy
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
AbcempidVarchar(1)100%... 123weightNumeric(21)100%123emp_catInteger100%1 1 ... 140.5 933 2 2 ... 175.0 945 3 3 ... 156.5 723 4 4 ... 178.0 799 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.