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'.

Returns

vDataFrame : self

Example

In [106]:
from verticapy.datasets import load_iris
iris = load_iris()
display(iris)
123
SepalLengthCm
Numeric(5,2)
Abc
Species
Varchar(30)
123
PetalLengthCm
Numeric(5,2)
123
SepalWidthCm
Numeric(5,2)
123
PetalWidthCm
Numeric(5,2)
14.30Iris-setosa1.103.000.10
24.40Iris-setosa1.402.900.20
34.40Iris-setosa1.303.000.20
44.40Iris-setosa1.303.200.20
54.50Iris-setosa1.302.300.30
64.60Iris-setosa1.503.100.20
74.60Iris-setosa1.403.200.20
84.60Iris-setosa1.403.400.30
94.60Iris-setosa1.003.600.20
104.70Iris-setosa1.303.200.20
114.70Iris-setosa1.603.200.20
124.80Iris-setosa1.403.000.10
134.80Iris-setosa1.403.000.30
144.80Iris-setosa1.603.100.20
154.80Iris-setosa1.603.400.20
164.80Iris-setosa1.903.400.20
174.90Iris-versicolor3.302.401.00
184.90Iris-virginica4.502.501.70
194.90Iris-setosa1.403.000.20
204.90Iris-setosa1.503.100.10
214.90Iris-setosa1.503.100.10
224.90Iris-setosa1.503.100.10
235.00Iris-versicolor3.502.001.00
245.00Iris-versicolor3.302.301.00
255.00Iris-setosa1.603.000.20
265.00Iris-setosa1.203.200.20
275.00Iris-setosa1.403.300.20
285.00Iris-setosa1.503.400.20
295.00Iris-setosa1.603.400.40
305.00Iris-setosa1.303.500.30
315.00Iris-setosa1.603.500.60
325.00Iris-setosa1.403.600.20
335.10Iris-versicolor3.002.501.10
345.10Iris-setosa1.703.300.50
355.10Iris-setosa1.503.400.20
365.10Iris-setosa1.403.500.20
375.10Iris-setosa1.403.500.30
385.10Iris-setosa1.503.700.40
395.10Iris-setosa1.503.800.30
405.10Iris-setosa1.603.800.20
415.10Iris-setosa1.903.800.40
425.20Iris-versicolor3.902.701.40
435.20Iris-setosa1.403.400.20
445.20Iris-setosa1.503.500.20
455.20Iris-setosa1.504.100.10
465.30Iris-setosa1.503.700.20
475.40Iris-versicolor4.503.001.50
485.40Iris-setosa1.503.400.40
495.40Iris-setosa1.703.400.20
505.40Iris-setosa1.503.700.20
515.40Iris-setosa1.303.900.40
525.40Iris-setosa1.703.900.40
535.50Iris-versicolor4.002.301.30
545.50Iris-versicolor3.702.401.00
555.50Iris-versicolor3.802.401.10
565.50Iris-versicolor4.002.501.30
575.50Iris-versicolor4.402.601.20
585.50Iris-setosa1.303.500.20
595.50Iris-setosa1.404.200.20
605.60Iris-versicolor3.902.501.10
615.60Iris-versicolor4.202.701.30
625.60Iris-virginica4.902.802.00
635.60Iris-versicolor3.602.901.30
645.60Iris-versicolor4.103.001.30
655.60Iris-versicolor4.503.001.50
665.70Iris-virginica5.002.502.00
675.70Iris-versicolor3.502.601.00
685.70Iris-versicolor4.102.801.30
695.70Iris-versicolor4.502.801.30
705.70Iris-versicolor4.202.901.30
715.70Iris-versicolor4.203.001.20
725.70Iris-setosa1.703.800.30
735.70Iris-setosa1.504.400.40
745.80Iris-versicolor4.002.601.20
755.80Iris-versicolor3.902.701.20
765.80Iris-versicolor4.102.701.00
775.80Iris-virginica5.102.701.90
785.80Iris-virginica5.102.701.90
795.80Iris-virginica5.102.802.40
805.80Iris-setosa1.204.000.20
815.90Iris-versicolor4.203.001.50
825.90Iris-virginica5.103.001.80
835.90Iris-versicolor4.803.201.80
846.00Iris-versicolor4.002.201.00
856.00Iris-virginica5.002.201.50
866.00Iris-versicolor5.102.701.60
876.00Iris-versicolor4.502.901.50
886.00Iris-virginica4.803.001.80
896.00Iris-versicolor4.503.401.60
906.10Iris-virginica5.602.601.40
916.10Iris-versicolor4.002.801.30
926.10Iris-versicolor4.702.801.20
936.10Iris-versicolor4.702.901.40
946.10Iris-versicolor4.603.001.40
956.10Iris-virginica4.903.001.80
966.20Iris-versicolor4.502.201.50
976.20Iris-virginica4.802.801.80
986.20Iris-versicolor4.302.901.30
996.20Iris-virginica5.403.402.30
1006.30Iris-versicolor4.402.301.30
Rows: 1-100 of 150 | Columns: 5
In [107]:
# Adding another vDataFrame with the same columns name
iris.append(iris)
123
SepalLengthCm
Numeric(5,2)
Abc
Species
Varchar(30)
123
PetalLengthCm
Numeric(5,2)
123
SepalWidthCm
Numeric(5,2)
123
PetalWidthCm
Numeric(5,2)
14.30Iris-setosa1.103.000.10
24.40Iris-setosa1.402.900.20
34.40Iris-setosa1.303.000.20
44.40Iris-setosa1.303.200.20
54.50Iris-setosa1.302.300.30
64.60Iris-setosa1.503.100.20
74.60Iris-setosa1.403.200.20
84.60Iris-setosa1.403.400.30
94.60Iris-setosa1.003.600.20
104.70Iris-setosa1.303.200.20
114.70Iris-setosa1.603.200.20
124.80Iris-setosa1.403.000.10
134.80Iris-setosa1.403.000.30
144.80Iris-setosa1.603.100.20
154.80Iris-setosa1.603.400.20
164.80Iris-setosa1.903.400.20
174.90Iris-versicolor3.302.401.00
184.90Iris-virginica4.502.501.70
194.90Iris-setosa1.403.000.20
204.90Iris-setosa1.503.100.10
214.90Iris-setosa1.503.100.10
224.90Iris-setosa1.503.100.10
235.00Iris-versicolor3.502.001.00
245.00Iris-versicolor3.302.301.00
255.00Iris-setosa1.603.000.20
265.00Iris-setosa1.203.200.20
275.00Iris-setosa1.403.300.20
285.00Iris-setosa1.503.400.20
295.00Iris-setosa1.603.400.40
305.00Iris-setosa1.303.500.30
315.00Iris-setosa1.603.500.60
325.00Iris-setosa1.403.600.20
335.10Iris-versicolor3.002.501.10
345.10Iris-setosa1.703.300.50
355.10Iris-setosa1.503.400.20
365.10Iris-setosa1.403.500.20
375.10Iris-setosa1.403.500.30
385.10Iris-setosa1.503.700.40
395.10Iris-setosa1.503.800.30
405.10Iris-setosa1.603.800.20
415.10Iris-setosa1.903.800.40
425.20Iris-versicolor3.902.701.40
435.20Iris-setosa1.403.400.20
445.20Iris-setosa1.503.500.20
455.20Iris-setosa1.504.100.10
465.30Iris-setosa1.503.700.20
475.40Iris-versicolor4.503.001.50
485.40Iris-setosa1.503.400.40
495.40Iris-setosa1.703.400.20
505.40Iris-setosa1.503.700.20
515.40Iris-setosa1.303.900.40
525.40Iris-setosa1.703.900.40
535.50Iris-versicolor4.002.301.30
545.50Iris-versicolor3.702.401.00
555.50Iris-versicolor3.802.401.10
565.50Iris-versicolor4.002.501.30
575.50Iris-versicolor4.402.601.20
585.50Iris-setosa1.303.500.20
595.50Iris-setosa1.404.200.20
605.60Iris-versicolor3.902.501.10
615.60Iris-versicolor4.202.701.30
625.60Iris-virginica4.902.802.00
635.60Iris-versicolor3.602.901.30
645.60Iris-versicolor4.103.001.30
655.60Iris-versicolor4.503.001.50
665.70Iris-virginica5.002.502.00
675.70Iris-versicolor3.502.601.00
685.70Iris-versicolor4.102.801.30
695.70Iris-versicolor4.502.801.30
705.70Iris-versicolor4.202.901.30
715.70Iris-versicolor4.203.001.20
725.70Iris-setosa1.703.800.30
735.70Iris-setosa1.504.400.40
745.80Iris-versicolor4.002.601.20
755.80Iris-versicolor3.902.701.20
765.80Iris-versicolor4.102.701.00
775.80Iris-virginica5.102.701.90
785.80Iris-virginica5.102.701.90
795.80Iris-virginica5.102.802.40
805.80Iris-setosa1.204.000.20
815.90Iris-versicolor4.203.001.50
825.90Iris-virginica5.103.001.80
835.90Iris-versicolor4.803.201.80
846.00Iris-versicolor4.002.201.00
856.00Iris-virginica5.002.201.50
866.00Iris-versicolor5.102.701.60
876.00Iris-versicolor4.502.901.50
886.00Iris-virginica4.803.001.80
896.00Iris-versicolor4.503.401.60
906.10Iris-virginica5.602.601.40
916.10Iris-versicolor4.002.801.30
926.10Iris-versicolor4.702.801.20
936.10Iris-versicolor4.702.901.40
946.10Iris-versicolor4.603.001.40
956.10Iris-virginica4.903.001.80
966.20Iris-versicolor4.502.201.50
976.20Iris-virginica4.802.801.80
986.20Iris-versicolor4.302.901.30
996.20Iris-virginica5.403.402.30
1006.30Iris-versicolor4.402.301.30
Out[107]:
Rows: 1-100 of 300 | Columns: 5
In [108]:
# Adding another relation with the same columns name
iris.append("public.iris")
123
SepalLengthCm
Numeric(5,2)
Abc
Species
Varchar(30)
123
PetalLengthCm
Numeric(5,2)
123
SepalWidthCm
Numeric(5,2)
123
PetalWidthCm
Numeric(5,2)
14.30Iris-setosa1.103.000.10
24.40Iris-setosa1.402.900.20
34.40Iris-setosa1.303.000.20
44.40Iris-setosa1.303.200.20
54.50Iris-setosa1.302.300.30
64.60Iris-setosa1.503.100.20
74.60Iris-setosa1.403.200.20
84.60Iris-setosa1.403.400.30
94.60Iris-setosa1.003.600.20
104.70Iris-setosa1.303.200.20
114.70Iris-setosa1.603.200.20
124.80Iris-setosa1.403.000.10
134.80Iris-setosa1.403.000.30
144.80Iris-setosa1.603.100.20
154.80Iris-setosa1.603.400.20
164.80Iris-setosa1.903.400.20
174.90Iris-versicolor3.302.401.00
184.90Iris-virginica4.502.501.70
194.90Iris-setosa1.403.000.20
204.90Iris-setosa1.503.100.10
214.90Iris-setosa1.503.100.10
224.90Iris-setosa1.503.100.10
235.00Iris-versicolor3.502.001.00
245.00Iris-versicolor3.302.301.00
255.00Iris-setosa1.603.000.20
265.00Iris-setosa1.203.200.20
275.00Iris-setosa1.403.300.20
285.00Iris-setosa1.503.400.20
295.00Iris-setosa1.603.400.40
305.00Iris-setosa1.303.500.30
315.00Iris-setosa1.603.500.60
325.00Iris-setosa1.403.600.20
335.10Iris-versicolor3.002.501.10
345.10Iris-setosa1.703.300.50
355.10Iris-setosa1.503.400.20
365.10Iris-setosa1.403.500.20
375.10Iris-setosa1.403.500.30
385.10Iris-setosa1.503.700.40
395.10Iris-setosa1.503.800.30
405.10Iris-setosa1.603.800.20
415.10Iris-setosa1.903.800.40
425.20Iris-versicolor3.902.701.40
435.20Iris-setosa1.403.400.20
445.20Iris-setosa1.503.500.20
455.20Iris-setosa1.504.100.10
465.30Iris-setosa1.503.700.20
475.40Iris-versicolor4.503.001.50
485.40Iris-setosa1.503.400.40
495.40Iris-setosa1.703.400.20
505.40Iris-setosa1.503.700.20
515.40Iris-setosa1.303.900.40
525.40Iris-setosa1.703.900.40
535.50Iris-versicolor4.002.301.30
545.50Iris-versicolor3.702.401.00
555.50Iris-versicolor3.802.401.10
565.50Iris-versicolor4.002.501.30
575.50Iris-versicolor4.402.601.20
585.50Iris-setosa1.303.500.20
595.50Iris-setosa1.404.200.20
605.60Iris-versicolor3.902.501.10
615.60Iris-versicolor4.202.701.30
625.60Iris-virginica4.902.802.00
635.60Iris-versicolor3.602.901.30
645.60Iris-versicolor4.103.001.30
655.60Iris-versicolor4.503.001.50
665.70Iris-virginica5.002.502.00
675.70Iris-versicolor3.502.601.00
685.70Iris-versicolor4.102.801.30
695.70Iris-versicolor4.502.801.30
705.70Iris-versicolor4.202.901.30
715.70Iris-versicolor4.203.001.20
725.70Iris-setosa1.703.800.30
735.70Iris-setosa1.504.400.40
745.80Iris-versicolor4.002.601.20
755.80Iris-versicolor3.902.701.20
765.80Iris-versicolor4.102.701.00
775.80Iris-virginica5.102.701.90
785.80Iris-virginica5.102.701.90
795.80Iris-virginica5.102.802.40
805.80Iris-setosa1.204.000.20
815.90Iris-versicolor4.203.001.50
825.90Iris-virginica5.103.001.80
835.90Iris-versicolor4.803.201.80
846.00Iris-versicolor4.002.201.00
856.00Iris-virginica5.002.201.50
866.00Iris-versicolor5.102.701.60
876.00Iris-versicolor4.502.901.50
886.00Iris-virginica4.803.001.80
896.00Iris-versicolor4.503.401.60
906.10Iris-virginica5.602.601.40
916.10Iris-versicolor4.002.801.30
926.10Iris-versicolor4.702.801.20
936.10Iris-versicolor4.702.901.40
946.10Iris-versicolor4.603.001.40
956.10Iris-virginica4.903.001.80
966.20Iris-versicolor4.502.201.50
976.20Iris-virginica4.802.801.80
986.20Iris-versicolor4.302.901.30
996.20Iris-virginica5.403.402.30
1006.30Iris-versicolor4.402.301.30
Out[108]:
Rows: 1-100 of 300 | Columns: 5
In [109]:
# Considering only specific columns
iris.append(iris,
            expr1 = ["SepalLengthCm AS sl", "PetalLengthCm AS pl"],
            expr2 = ["SepalLengthCm AS sl", "PetalLengthCm AS pl"])
123
sl
Numeric(5,2)
123
pl
Numeric(5,2)
14.301.10
24.401.40
34.401.30
44.401.30
54.501.30
64.601.50
74.601.40
84.601.40
94.601.00
104.701.30
114.701.60
124.801.40
134.801.40
144.801.60
154.801.60
164.801.90
174.903.30
184.904.50
194.901.40
204.901.50
214.901.50
224.901.50
235.003.50
245.003.30
255.001.60
265.001.20
275.001.40
285.001.50
295.001.60
305.001.30
315.001.60
325.001.40
335.103.00
345.101.70
355.101.50
365.101.40
375.101.40
385.101.50
395.101.50
405.101.60
415.101.90
425.203.90
435.201.40
445.201.50
455.201.50
465.301.50
475.404.50
485.401.50
495.401.70
505.401.50
515.401.30
525.401.70
535.504.00
545.503.70
555.503.80
565.504.00
575.504.40
585.501.30
595.501.40
605.603.90
615.604.20
625.604.90
635.603.60
645.604.10
655.604.50
665.705.00
675.703.50
685.704.10
695.704.50
705.704.20
715.704.20
725.701.70
735.701.50
745.804.00
755.803.90
765.804.10
775.805.10
785.805.10
795.805.10
805.801.20
815.904.20
825.905.10
835.904.80
846.004.00
856.005.00
866.005.10
876.004.50
886.004.80
896.004.50
906.105.60
916.104.00
926.104.70
936.104.70
946.104.60
956.104.90
966.204.50
976.204.80
986.204.30
996.205.40
1006.304.40
Out[109]:
Rows: 1-100 of 300 | Columns: 2

See Also

vDataFrame.groupby Aggregates the vDataFrame.
vDataFrame.join Joins the vDataFrame with another relation.
vDataFrame.sort Sorts the vDataFrame.