vastorbit.VastFrame.get_columns¶
- VastFrame.get_columns(exclude_columns: Annotated[str | list[str], 'STRING representing one column or a list of columns'] | None = None) list[str]¶
Returns the VastFrame VastColumns.
- Parameters:
exclude_columns (SQLColumns, optional) – List of the VastColumns names to exclude from the final list.
- Returns:
List of all VastFrame columns.
- Return type:
List
Examples
Let’s begin by importing 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.Let us create a
VastFramewith multiple columns:vdf = vo.VastFrame( { "col1": [1, 2, 3], "col2": [1, 2, 3], "col3": [1, 2, 3], "col4": [1, 2, 3], } )
123col1Integer123col2Integer123col3Integer123col4Integer1 2 2 2 2 2 3 3 3 3 3 1 1 1 1 Rows: 1-3 | Columns: 4We can get the column names by:
vdf.get_columns()
Some columns could also be directly excluded:
vdf.get_columns(exclude_columns = "col1")