vDataFrame.append¶
In [ ]:
vDataFrame.append(input_relation,
expr1: list = [],
expr2: list = [],
union_all: bool = True)
Merges the vDataFrame with another vDataFrame or an input relation and returns a new vDataFrame.
Parameters¶
| Name | Type | Optional | Description |
|---|---|---|---|
input_relation | str / vDataFrame | ❌ | Relation to merge with. |
expr1 | list | ✓ | List of pure SQL expressions from the current vDataFrame to use during the merge. If empty, all the vDataFrame vcolumns will be used. Aliases are recommended to avoid automatic naming.
Examples: 'CASE WHEN "column" > 3 THEN 2 ELSE NULL END' or 'POWER("column", 2).' |
expr2 | list | ✓ | List of pure SQL expressions from the input vDataFrame to use during the merge. If empty, all the vDataFrame vcolumns will be used. Aliases are recommended to avoid automatic naming.
Examples: 'CASE WHEN "column" > 3 THEN 2 ELSE NULL END' or 'POWER("column", 2).' |
union_all | bool | ✓ | If set to True, the vDataFrame will be merged with the input relation with 'UNION ALL' instead of an 'UNION'. |
In [106]:
from verticapy.datasets import load_iris
iris = load_iris()
display(iris)
In [107]:
# Adding another vDataFrame with the same columns name
iris.append(iris)
Out[107]:
In [108]:
# Adding another relation with the same columns name
iris.append("public.iris")
Out[108]:
In [109]:
# Considering only specific columns
iris.append(iris,
expr1 = ["SepalLengthCm AS sl", "PetalLengthCm AS pl"],
expr2 = ["SepalLengthCm AS sl", "PetalLengthCm AS pl"])
Out[109]:
See Also¶
| vDataFrame.groupby | Aggregates the vDataFrame. |
| vDataFrame.join | Joins the vDataFrame with another relation. |
| vDataFrame.sort | Sorts the vDataFrame. |
