I try to iterate over a specific column called Description
of the dataframe RCMLocations
.
When the value of the column "Description" is equal to the value found in another dataframe called "ultimo_data", then take the value of dataframe "ulimo_data" column "Systeemdeelnummer" and place it in a new column "ID" in the dataframe "RCMLocations".
However, with the code below I can not iterate over the dataframe RCMLocations
. How do I solve this problem?
beheerobjecten = ultimo_data["Specifieke_omschrijving_beheerobject"].unique()
RCMLocations["ID"] = ""
for i, row in RCMLocations.iterrows:
RCMLocations["ID"] = ultimo_data.loc[ultimo_data["Specifieke_omschrijving_beheerobject"] == row["Description"], "Systeemdeelnummer"]
Below is reproducible example of a dataframe:
RCMLocations = pd.DataFrame({"Description": ["Description 0 Weg, 4,300 tm 16,765 KP Zaandam - Purmerend Noord", "Description 1 Weg, 16,765 tm 34,032 Purmerend Noord - Hoorn Noord", "Description 2 Weg, 50,212 tm 64,565 Middenmeer - Den Oever"]})