In this tutorial we are going to learn the pandas Merge statement.


Buy Me a Coffee? Your support is much appreciated!
PayPal Me: https://www.paypal.me/jiejenn/5
Venmo: @Jie-Jenn



Open Documentation
Documentation

Raw data for example 1:

customers = {
    'CustomerId': [1, 2, 3, 4],
    'CustomerName': ['Anna', 'John', 'Mary', 'Jay'],
    'Country': ['USA', 'Canada', 'Mexico', 'USA']
}

orders = {
    'OrderId': [101, 102, 103, 105],
    'CustomerId': [1, 2, 3, 5],
    'OrderDate': ['10/01/2019', '10/02/2019', '10/03/2019', '10/05/2019']
}

address = {
    'CustId': [2, 4],
    'Address': ['123 Maple St', '333 Market St']
}



Raw data for example 2:

customers = {
    'CustomerId': [101, 101, 102, 103],
    'key': ['a', 'b', 'c', 'd'],
    'CustomerName': ['Anna', 'John', 'Mary', 'Jay'],
    'Country': ['USA', 'Canada', 'Mexico', 'USA']
}


orders = {
    'OrderId': [1, 2, 3, 4],
    'key': ['a', 'b', 'c', 'd'],
    'CustomerId': [101, 101, 102, 105],
    'OrderDate': ['10/01/2019', '10/02/2019', '10/03/2019', '10/05/2019']
}