I have 2 dataframes with the following structure:
DF1
ItemID Item
Id1 Item1
Id2 Item2
Id3 Item3
... ...
1000 Item1000
DF2
Index ListOfItems
0 [Item1]
1 [Item1, Item3, Item5]
2 [Item2, Item3]
... ...
N [NItems]
This will be my expected output:
Index ListOfItems ListOfIds
0 [Item1] [Id1]
1 [Item1, Item3, Item5] [Id1, Id3, Id5]
2 [Item2, Item3] [Id2, Id3]
... ... ...
N [NItems] [NIds]
which is matching the ListOfItmes of the second Dataframe with the Ids of the first Dataframe and create the list of Ids in a new column
This is done over a large dataframe that is constantly changing, so performance is important. I have tried some approaches but the performance is pretty poor.