Hi, i have two dataframes and i want to change values in first dataframe where have same IDs in both dataframes, suppose i have:
df1 = [ID price
1 200
4 300
5 120
7 230
8 110
9 90
12 180]
and
df2 = [ID price count
3 340 27
4 60 10
5 290 2]
after replace:
df1 = [ID price
1 200
4 60
5 290
7 230
8 110
9 90
12 180]
my first try:
df1.loc[df1.ID.isin(df2.ID),['price']] = df2.loc[df2.ID.isin(df1.ID),['price']].values
but it isn't correct.