I have 2 dataframes :
df:
portfolio symbol id var1 var2 var3
df1:
symbol sector market count
I want to add the columns sector and market from df1 to df. df1 has uniques values for symbol and hence a smaller dataframe than df which is the original dataframe.
I tried doing :
pd.merge(df,df1,on='symbol',how='outer')
But the output is extending rows than desired. Can anyone help as to what is missed out here.
Thanks
But the output is extending rows than desired.It seems not, how workingpd.merge(df,df1.drop_duplicates('symbol'),on='symbol',how='outer')?