Skip to content

Instantly share code, notes, and snippets.

@karanjagota karanjagota/merge_ex.py Secret
Created Jul 6, 2019

Embed
What would you like to do?
gist for medium blogs
import pandas as pd
# loading data
data_1 = {'gold':['day1','day2','day3','day4','day5'],
'2015':[10,20,30,40,50],
'2016':[15,25,35,45,55],
'2017':[17,27,37,47,57],
'2018':[19,29,39,49,59]}
data_2 = {'gold':['day1','day2','day3','day4','day5'],
'2019':[20,20,40,80,50],
'2020':[35,45,75,45,55],
'2021':[87,27,37,47,57],
'2022':[79,89,99,39,49]}
# Data Frames
df1 = pd.DataFrame(data_1)
df2 = pd.DataFrame(data_2)
# Merging DataFrames
merge_df = pd.merge(df1, df2, on='gold')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.