Loading...

vastorbit.VastFrame.shape

VastFrame.shape() tuple[int, int]

Returns the number of rows and columns of the VastFrame.

Returns:

(number of rows, number of columns)

Return type:

tuple

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
13333
22222
31111
Rows: 1-3 | Columns: 4

We can get the shape of the VastFrame by:

vdf.shape()

Note

This function differs from the pandas shape attribute since the size can be dynamically adjusted based on live modifications to the relation, such as the ingestion of new data or alterations to the relation.

If you want to ensure the stability of the relation, you can create a temporary local table or a table in a schema where only you have privileges.

See also

VastFrame.iloc() : Select rows from the VastFrame.