# -*- coding: utf-8 -*-

# ライブラリをロード
import pandas as pd

# DataFrameを作成
employee_data = {'employee_id': ['1', '2', '3', '4'],
                 'name': ['Amy Jones', 'Allen Keys', 'Alice Bees',
                 'Tim Horton']}
dataframe_employees = pd.DataFrame(employee_data, columns = ['employee_id',
                                                              'name'])

# DataFrameを作成
sales_data = {'employee_id': ['3', '4', '5', '6'],
              'total_sales': [23456, 2512, 2345, 1455]}
dataframe_sales = pd.DataFrame(sales_data, columns = ['employee_id',
                                                      'total_sales'])

# DataFrameをマージ
pd.merge(dataframe_employees, dataframe_sales, on='employee_id')

##########

# DataFrameをマージ
pd.merge(dataframe_employees, dataframe_sales, on='employee_id', how='outer')

##########

# DataFrameをマージ
pd.merge(dataframe_employees, dataframe_sales, on='employee_id', how='left')

##########

# DataFrameをマージ
pd.merge(dataframe_employees,
         dataframe_sales,
         left_on='employee_id',
         right_on='employee_id')


b879789ade319c8e84ee5fc8c91998acae5d6fd4
<mask token>

<mask token>
pd.merge(dataframe_employees, dataframe_sales, on='employee_id')
pd.merge(dataframe_employees, dataframe_sales, on='employee_id', how='outer')
pd.merge(dataframe_employees, dataframe_sales, on='employee_id', how='left')
pd.merge(dataframe_employees, dataframe_sales, left_on='employee_id',
    right_on='employee_id')

<mask token>
employee_data = {'employee_id': ['1', '2', '3', '4'], 'name': ['Amy Jones',
    'Allen Keys', 'Alice Bees', 'Tim Horton']}
dataframe_employees = pd.DataFrame(employee_data, columns=['employee_id',
    'name'])
sales_data = {'employee_id': ['3', '4', '5', '6'], 'total_sales': [23456, 
    2512, 2345, 1455]}
dataframe_sales = pd.DataFrame(sales_data, columns=['employee_id',
    'total_sales'])
pd.merge(dataframe_employees, dataframe_sales, on='employee_id')
pd.merge(dataframe_employees, dataframe_sales, on='employee_id', how='outer')
pd.merge(dataframe_employees, dataframe_sales, on='employee_id', how='left')
pd.merge(dataframe_employees, dataframe_sales, left_on='employee_id',
    right_on='employee_id')

import pandas as pd
employee_data = {'employee_id': ['1', '2', '3', '4'], 'name': ['Amy Jones',
    'Allen Keys', 'Alice Bees', 'Tim Horton']}
dataframe_employees = pd.DataFrame(employee_data, columns=['employee_id',
    'name'])
sales_data = {'employee_id': ['3', '4', '5', '6'], 'total_sales': [23456, 
    2512, 2345, 1455]}
dataframe_sales = pd.DataFrame(sales_data, columns=['employee_id',
    'total_sales'])
pd.merge(dataframe_employees, dataframe_sales, on='employee_id')
pd.merge(dataframe_employees, dataframe_sales, on='employee_id', how='outer')
pd.merge(dataframe_employees, dataframe_sales, on='employee_id', how='left')
pd.merge(dataframe_employees, dataframe_sales, left_on='employee_id',
    right_on='employee_id')

# -*- coding: utf-8 -*-

# ライブラリをロード
import pandas as pd

# DataFrameを作成
employee_data = {'employee_id': ['1', '2', '3', '4'],
                 'name': ['Amy Jones', 'Allen Keys', 'Alice Bees',
                 'Tim Horton']}
dataframe_employees = pd.DataFrame(employee_data, columns = ['employee_id',
                                                              'name'])

# DataFrameを作成
sales_data = {'employee_id': ['3', '4', '5', '6'],
              'total_sales': [23456, 2512, 2345, 1455]}
dataframe_sales = pd.DataFrame(sales_data, columns = ['employee_id',
                                                      'total_sales'])

# DataFrameをマージ
pd.merge(dataframe_employees, dataframe_sales, on='employee_id')

##########

# DataFrameをマージ
pd.merge(dataframe_employees, dataframe_sales, on='employee_id', how='outer')

##########

# DataFrameをマージ
pd.merge(dataframe_employees, dataframe_sales, on='employee_id', how='left')

##########

# DataFrameをマージ
pd.merge(dataframe_employees,
         dataframe_sales,
         left_on='employee_id',
         right_on='employee_id')

