I have a problem updatding a column value from a second dataframe that is a dictiorany/catalog.
This is my main dataframe (df)
and the dictionary dataframe (dictionary)
I want to update the column df.City of the main df from the dictionary with the condition where df.id_state = dictiorary.ID_State and df.ID_City = dictionary.Id_City.
I don't know how to do that with a dictionary with 3 columns. I already did it with a normal dictionary of 2 columns.
rename_dict_E = df_Ent.set_index('ID_State').to_dict()['State'] df_CovidMx.ID_State = df_CovidMx.ID_State.replace(rename_dict_E)
I hope somebody can give me a hand!
Regard. Im learning Python