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:
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 fromvastorbitare 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'] } )
123col1Integer123col2IntegerAbccolVarchar(1)1 1 3 a 2 2 3 b 3 3 1 v Rows: 1-3 | Columns: 3Note
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
dropwe can take out any column that we do not need:vdf.drop("col1")
123col2IntegerAbccolVarchar(1)1 3 a 2 3 b 3 1 v Rows: 1-3 | Columns: 2See also
VastFrame.balance(): Balances the VastFrame.VastFrame.drop_duplicates(): Drops the VastFrame duplicates.