Loading...

verticapy.vDataFrame.memory_usage#

vDataFrame.memory_usage() TableSample#

Returns the vDataFrame memory usage.

Returns#

TableSample

result.

Examples#

Let’s begin by importing VerticaPy.

import verticapy as vp

Hint

By assigning an alias to verticapy, we mitigate the risk of code collisions with other libraries. This precaution is necessary because verticapy 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 verticapy are used as intended without interfering with functions from other libraries.

Let us create a dummy dataset and check its memory usage:

vdf = vp.vDataFrame({"val": [0, 10, 20]})
123
val
Integer
100%
10
210
320

We can see the memory usage of the vDataFrame using:

vdf.memory_usage()
Out[2]: 
None        value  
object       1039  
"time"       1834  
"val"        1777  
total        4650  
Rows: 1-4 | Columns: 2

See also

vDataFrame.expected_store_usage() : Returns the vDataFrame expected store usage.