Loading...

verticapy.vDataFrame.del_catalog#

vDataFrame.del_catalog() vDataFrame#

Deletes the current vDataFrame catalog.

Returns#

vDataFrame

self

Examples#

Aggregate results are cached to optimize computation. Sometimes cached results can be problemtic or not desired. In those cases del_catalog can be used to delete all cached aggregates.

Let us look at the below example:

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.

We have a dummy data:

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

We can create the summary of the vDataFrame using:

vdf.describe()
...
approx_75%
max
"val"...15.020.0

No if we look at the cache, we can see the stored values:

vdf["val"]._catalog
Out[3]: 
{'cov': {},
 'pearson': {},
 'spearman': {},
 'spearmand': {},
 'kendall': {},
 'cramer': {},
 'biserial': {},
 'regr_avgx': {},
 'regr_avgy': {},
 'regr_count': {},
 'regr_intercept': {},
 'regr_r2': {},
 'regr_slope': {},
 'regr_sxx': {},
 'regr_sxy': {},
 'regr_syy': {},
 'count': 3,
 'avg': 10,
 'std': 10,
 'min': 0,
 'approx_25%': 5,
 'approx_50%': 10,
 'approx_75%': 15,
 'max': 20}

In order to erase the stored values we can use:

vdf.del_catalog()

Now there will not be any stored values:

vdf["val"]._catalog
Out[4]: 
{'cov': {},
 'pearson': {},
 'spearman': {},
 'spearmand': {},
 'kendall': {},
 'cramer': {},
 'biserial': {},
 'regr_avgx': {},
 'regr_avgy': {},
 'regr_count': {},
 'regr_intercept': {},
 'regr_r2': {},
 'regr_slope': {},
 'regr_sxx': {},
 'regr_sxy': {},
 'regr_syy': {},
 'percent': 100}

See also

vDataFrame.explain() : Information on how Vertica is computing the current vDataFrame relation.