vastorbit.core.tablesample.base.TableSample.merge¶
- TableSample.merge(tbs: TableSample) TableSample¶
Merges the input
TableSampleto a targetTableSample.- Parameters:
tbs (TableSample) –
TableSampleto merge.- Returns:
self.
- Return type:
Examples
Let’s import the
TableSampleobject:from vastorbit 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 1 0 40 Roger 2 1 30 Maria 3 2 22 Alisia 4 3 55 Costi Rows: 1-4 | Columns: 3Let’s build a second object example.
# dict with all the data. d = { "location": ['Romania', 'Sofia', 'Istanbul', 'Chicago'], } # creating the object. tb2 = TableSample(d)
location 1 Romania 2 Sofia 3 Istanbul 4 Chicago Rows: 1-4 | Column: location | Type: undefinedLet’s use the function.
tb.merge(tb2)
customer_ID age name location 1 0 40 Roger Romania 2 1 30 Maria Sofia 3 2 22 Alisia Istanbul 4 3 55 Costi Chicago Rows: 1-4 | Columns: 4Warning
This will modify the main object, and the input
TableSamplewill be merged to it.See also