These are my dataframes:
df1 = pd.DataFrame({'sym': ['msft', 'msft', 'amd', 'amd'], 'close': [102, 100, 35, 30]})
df2 = pd.DataFrame({'sym': ['msft', 'amd'], 'close': [103, 36]})
I want to combine df1 and df2 in a way that a first row is added for each group of sym in df1. This is a simplified dataframe, my original has thousand of rows.
This is my desired outcome:
sym close
0 msft 103
1 msft 102
2 msft 100
3 amd 36
4 amd 35
5 amd 30