Loading...

vastorbit.VastFrame.drop

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

Drops the input VastColumns from the VastFrame. Dropping VastColumns means they are not selected in the final SQL code generation.

Warning

Be careful when using this method. It can make the VastFrame structure heavier if other VastColumns are computed using the dropped VastColumns.

Parameters:

columns (SQLColumns, optional) – List of the VastColumns names.

Returns:

self

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)
113a
223b
331v
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.drop("col1")
123
col2
Integer
Abc
col
Varchar(1)
13a
23b
31v
Rows: 1-3 | Columns: 2

See also

VastFrame.balance() : Balances the VastFrame.
VastFrame.drop_duplicates() : Drops the VastFrame duplicates.