Loading...

verticapy.core.tablesample.base.TableSample.merge#

TableSample.merge(tbs: TableSample) TableSample#

Merges the input TableSample to a target TableSample.

Parameters#

tbs: TableSample

TableSample to merge.

Returns#

TableSample

self.

Examples#

Let’s import the TableSample object:

from verticapy import TableSample

Let’s build an example object.

# dict with all the data.
d = {
    "customer_ID": [0, 1, 2, 3],
    "age": [40, 30, 22, 55],
    "name": ['Roger', 'Maria', 'Alisia', 'Costi'],
}


# creating the object.
tb = TableSample(d)
customer_ID
age
name
1040Roger
2130Maria
3222Alisia
4355Costi
Rows: 1-4 | Columns: 3

Let’s build a second object example.

# dict with all the data.
d = {
    "location": ['Romania', 'Sofia', 'Istanbul', 'Chicago'],
}


# creating the object.
tb2 = TableSample(d)
location
1Romania
2Sofia
3Istanbul
4Chicago
Rows: 1-4 | Column: location | Type: undefined

Let’s use the function.

tb.merge(tb2)
customer_ID
age
name
location
1040RogerRomania
2130MariaSofia
3222AlisiaIstanbul
4355CostiChicago
Rows: 1-4 | Columns: 4

Warning

This will modify the main object, and the input TableSample will be merged to it.

See also

TableSample.append() : Appends the input TableSample to a target TableSample.