Loading...

vastorbit.VastColumn.drop

VastColumn.drop(add_history: bool = True) VastFrame

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

Warning

Dropping a VastColumn can make the VastFrame “heavier” if it is used to compute other VastColumns.

Parameters:

add_history (bool, optional) – If set to True, the information is stored in the VastFrame history.

Returns:

self._parent

Return type:

VastFrame

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.

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

vdf = vo.VastFrame(
    {
        "col1": [1, 2, 3],
        "col2": [3, 3, 1],
        "col":['a', 'b', 'v'],
    },
)
123
col1
Integer
123
col2
Integer
Abc
col
Varchar(1)
131v
223b
313a
Rows: 1-3 | Columns: 3

Note

vastorbit 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 vastorbit environment.

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

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

See also

VastColumn.drop() : Drops the input VastColumn.
VastFrame.drop_duplicates() : Drops the VastFrame duplicates.