Problem :
I have the two DataFrames which I would want to merge. I have referred many documents and also tried to perform many operations but I am not sure what to do now. Please find my two DataFrames as below:
DataFrame1:
id name type currency
0 BTTA.S Apple Hard GBp
1 VOOD.S Soft Soft GBp
and
DataFrame2:
id price
BTTA.S 301.2215250
VOOD.S 213.7914000
and I would like to return:
id name type currency price
0 BTTA.S Apple Hard GBp 301.2215250
1 VOOD.S Soft Soft GBp 213.7914000
Trying to merge the price column from the DataFrame2 with DataFrame1.
I have already tried many methods of doing this as below :
Result = DataFrame1.merge(DataFrame2[['*.S']], left_on='id', right_index=True)
But here I met with the exception as below :
ValueError: can not merge DataFrame with instance of type <class 'pandas.core.series.Series'>