Use of pd.merge() for merging two databases

ipython

#1

Hello,
I am tryin to merge two dataframes as following:
left = pd.DataFrame({‘a’:[12,23],‘b’:[23,34]})
right = pd.DataFrame({‘a’:[3,4],‘f’:[34,9]})
print pd.merge(left,right,on=‘a’)

but not getting the required output .


#2

instead of using pd.merge(left,right,on=‘a’) use pd.merge(left,right,on=‘a’,how=‘outer’)

hope it helps.