Loading...

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 from vastorbit are used as intended without interfering with functions from other libraries.

Let us create a VastFrame with multiple columns:

vdf = vo.VastFrame(
    {
        "col1": [1, 2, 3],
        "col2": [1, 2, 3],
        "col3": [1, 2, 3],
        "col4": [1, 2, 3],
    }
)
123
col1
Integer
123
col2
Integer
123
col3
Integer
123
col4
Integer
12222
23333
31111
Rows: 1-3 | Columns: 4

We can get the column names by:

vdf.get_columns()

Some columns could also be directly excluded:

vdf.get_columns(exclude_columns = "col1")

See also

VastFrame.head() : Get head of the VastFrame.
VastColumn.tail() : Get tail of the VastFrame.