vDataFrame[].agg / aggregate

In [ ]:
vDataFrame[].aggregate(func: list)

Aggregates the vcolumn using the input functions.

Parameters

Name Type Optional Description
func
list
❌
List of the different aggregation.
  • aad : average absolute deviation
  • approx_unique : approximative cardinality
  • count : number of non-missing elements
  • cvar : conditional value at risk
  • dtype : virtual column type
  • iqr : interquartile range
  • kurtosis : kurtosis
  • jb : Jarque Bera index
  • mad : median absolute deviation
  • max : maximum
  • mean : average
  • median : median
  • min : min
  • mode : most occurent element
  • percent : percent of non-missing elements
  • q% : q quantile (ex: 50% for the median)
  • prod : product
  • range : difference between the max and the min
  • sem : standard error of the mean
  • skewness : skewness
  • sum : sum
  • std : standard deviation
  • topk : kth most occurent element (ex: top1 for the mode)
  • topk_percent : kth most occurent element density
  • std : standard deviation
  • unique : cardinality (count distinct)
  • var : variance
  • Other aggregations could work if it is part of the DB version you are using.

Returns

tablesample : An object containing the result. For more information, see utilities.tablesample.

Example

In [12]:
from verticapy.datasets import load_titanic
titanic = load_titanic()
display(titanic["embarked"])
Abc
embarked
Varchar(20)
1S
2S
3S
4S
5C
6C
7S
8C
9C
10C
11S
12S
13S
14C
15C
16S
17S
18S
19S
20S
21S
22S
23S
24S
25C
26S
27S
28C
29S
30S
31C
32S
33C
34C
35C
36S
37C
38S
39S
40S
41S
42S
43S
44C
45C
46S
47C
48S
49S
50S
51S
52S
53S
54S
55S
56C
57C
58S
59S
60C
61C
62S
63S
64C
65S
66S
67S
68S
69C
70S
71C
72S
73Q
74S
75S
76C
77C
78S
79C
80C
81S
82S
83S
84S
85C
86S
87S
88C
89C
90S
91S
92C
93C
94S
95C
96S
97S
98C
99S
100S
Rows: 1-100 of 1234 | Column: embarked | Type: varchar(20)
In [13]:
titanic["embarked"].aggregate(func = ["unique", "top1", "top2"])
"embarked"
unique3
top1S
top2C
Out[13]:

See Also

vDataFrame.analytic Adds a new vcolumn to the vDataFrame by using an advanced analytical function on a specific vcolumn.