I'd like to replace the numbers in df1['City'] with the corresponding Citys from df2['City']. So that in DF1 the cities are written instead of the numbers.
DF1
|Citys | Flights | Date|
| -------- | -------- | ----|
| 0 | x |x |
| 1 | x |x |
| 2 | x |x |
| 4 | x |x |
| 3 | x |x |
| 2 | x |x |
| 1 |x |x |
| 4 |x |x |
| 3 |x |x |
DF2 | Number | City | | -------- | -------- | | 1 | Canberra | | 2 | Washington| | 3 | Rome | | 4 | Beijing |
I already tried it with a foor loop and tried to def an own function but it doesnt work. I'm searching for a method to change the values of the DF from another and dont want to use df.replace. Maybe it works with an of statement