Loading...

verticapy.vDataColumn.drop#

vDataColumn.drop(add_history: bool = True) vDataFrame#

Drops the vDataColumn from the vDataFrame. Dropping a vDataColumn means it is not selected in the final generated SQL code.

Warning

Dropping a vDataColumn can make the vDataFrame “heavier” if it is used to compute other vDataColumns.

Parameters#

add_history: bool, optional

If set to True, the information is stored in the vDataFrame history.

Returns#

vDataFrame

self._parent

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.

For this example, we will use a dummy dataset with three columns:

vdf = vp.vDataFrame(
    {
        "col1": [1, 2, 3],
        "col2": [3, 3, 1],
        "col":['a', 'b', 'v'],
    },
)

123
col1
Integer
100%
...
123
col2
Integer
100%
Abc
col
Varchar(1)
100%
11...3a
22...3b
33...1v

Note

VerticaPy offers a wide range of sample datasets that are ideal for training and testing purposes. You can explore the full list of available datasets in the Datasets, which provides detailed information on each dataset and how to use them effectively. These datasets are invaluable resources for honing your data analysis and machine learning skills within the VerticaPy environment.

Using drop we can take out any column that we do not need:

vdf["col1"].drop()
Out[3]: 
None  col2    col  
1       3      a  
2       3      b  
3       1      v  
Rows: 3 | Columns: 2
123
col2
Integer
100%
Abc
col
Varchar(1)
100%
13a
23b
31v

See also

vDataColumn.drop() : Drops the input vDataColumn.
vDataFrame.drop_duplicates() : Drops the vDataFrame duplicates.