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 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 3 3 3 3 2 2 2 2 2 3 1 1 1 1 Rows: 1-3 | Columns: 4We can get the shape of the
VastFrameby:vdf.shape()
Note
This function differs from the
pandasshapeattribute 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.