I have two dataframes, and one bigger dataframe needs to be updated based on data from smaller dataframe. So basically if there is a record with matching names I want to update the price in df1, just like in an example below. There might be multiple rows with the same name in df1
df1
id name price
1 name_1 5,34
2 name_2 5,36
3 name_3 4,74
4 name_4 5,23
5 name_5 5,94
6 name_1 5,34
df2
name price
name_4 5,17
name_1 5,37
df_result
id name price
1 name_1 5,37
2 name_2 5,36
3 name_3 4,74
4 name_4 5,17
5 name_5 5,94
6 name_1 5,37
I'm quite stuck. Tried doing this with df.loc[] but I got nowhere. Any ideas?