compute_vmap_keys

In [ ]:
compute_vmap_keys(expr, 
                  vmap_col: str,
                  limit: int,)

Computes the most frequent keys in the input VMap.

Parameters

Name Type Optional Description
expr
str / vDataFrame
Input expression. You can also specify a vDataFrame or a customized relation, but you must enclose it with an alias. For example, "(SELECT 1) x" is allowed, whereas "(SELECT 1)" and "SELECT 1" are not.
vmap_col
str
VMap column.
limit
int
Maximum number of keys to consider.

Returns

List of tuples : List of virtual column names and their respective frequencies.

Example

In [2]:
from verticapy.utilities import read_json, compute_vmap_keys

read_json("laliga/*.json", table_name = "laliga", materialize = False)
compute_vmap_keys(expr = "v_temp_schema.laliga", vmap_col = "__raw__",)
Out[2]:
[['away_team.away_team_id', 452],
 ['competition.competition_name', 452],
 ['home_team.country.name', 452],
 ['competition_stage.id', 452],
 ['away_team.away_team_group', 452],
 ['kick_off', 452],
 ['away_team.away_team_name', 452],
 ['home_team.home_team_gender', 452],
 ['home_team.country.id', 452],
 ['away_team.away_team_gender', 452],
 ['match_date', 452],
 ['competition.competition_id', 452],
 ['home_team.home_team_group', 452],
 ['home_team.home_team_name', 452],
 ['away_team.country.name', 452],
 ['home_team.home_team_id', 452],
 ['metadata.data_version', 452],
 ['metadata.shot_fidelity_version', 452],
 ['competition.country_name', 452],
 ['match_id', 452],
 ['season.season_id', 452],
 ['away_team.country.id', 452],
 ['match_week', 452],
 ['match_status', 452],
 ['last_updated', 452],
 ['away_score', 452],
 ['season.season_name', 452],
 ['competition_stage.name', 452],
 ['home_score', 452],
 ['metadata.xy_fidelity_version', 382],
 ['away_team.managers', 282],
 ['home_team.managers', 282],
 ['referee.name', 105],
 ['stadium.country.id', 105],
 ['referee.id', 105],
 ['stadium.country.name', 105],
 ['stadium.id', 105],
 ['stadium.name', 105],
 ['referee.country.id', 101],
 ['referee.country.name', 101]]