I have a dataframe with a certain ID and I also have a list dictionary. From the ID of the dataframe I need to update that ID if it exists in the dictionary but in the dictionary it is updated by two IDs, here are the examples: Dataframe
| ID | Name | Last Name |
|---|---|---|
| 1 | Peter | Smith |
| 2 | John | Allen |
| 7 | Rene | Watson |
| 8 | Dilan | Foster |
Dictionary
Dict = {1: [3, 4], 2: [5, 6], 7: [11], 8:[8]}
Expect Output:
| ID | Name | Last Name |
|---|---|---|
| 3 | Peter | Smith |
| 4 | Peter | Smith |
| 5 | John | Allen |
| 6 | John | Allen |
| 11 | Rene | Watson |
| 8 | Dilan | Foster |
Thanks in advance!