vDataFrameSQL

In [ ]:
vDataFrameSQL(relation: str, 
              name: str = "VDF", 
              schema: str = "public",
              history: list = [],
              saving: list = [])

Creates a vDataFrame based on a customized relation.

Parameters

Name Type Optional Description
relation
str
❌
Relation. It can be a customized relation but you need to englobe it using an alias. For example "(SELECT 1) x" is correct whereas "(SELECT 1)" or "SELECT 1" are incorrect.
name
str
✓
Name of the vDataFrame. It is used only when displaying the vDataFrame.
schema
str
✓
Relation schema. It can be to use to be less ambiguous and allow to create schema and relation name with dots '.' inside.
history
list
✓
vDataFrame history (user modifications). To use to keep the previous vDataFrame history.
saving
list
✓
List to use to reconstruct the vDataFrame from previous transformations.

Returns

vDataFrame : The vDataFrame associated to the input relation.

Example

In [2]:
from verticapy.utilities import vDataFrameSQL

vDataFrameSQL("(SELECT pclass, embarked, AVG(survived) FROM public.titanic GROUP BY 1, 2) x")
Out[2]:
123
pclass
Integer
Abc
embarked
Varchar(20)
123
AVG
Float
13C0.318681318681319
23Q0.260416666666667
33S0.203781512605042
42C0.555555555555556
52Q0.285714285714286
62S0.404444444444444
71[null]1.0
81C0.681481481481481
91Q0.666666666666667
101S0.552325581395349
Rows: 1-10 | Columns: 3