I have a data frame that looks like this:
| id | tag | cnt |
|---|---|---|
| 123 | Lorem | 34 |
| 123 | Ipsum | 12 |
| 456 | Ipsum | 10 |
| 456 | Dolor | 2 |
And another data frame that looks like this:
| id | tags |
|---|---|
| 123 | ['Ipsum','Lorem'] |
| 456 | ['Lorem', 'Dolor'] |
I need to find the index of each tag in df one in the list of tags in df two. So the new df one would look like:
| id | tag | cnt | Rank |
|---|---|---|---|
| 123 | Lorem | 34 | 2 |
| 123 | Ipsum | 12 | 1 |
| 456 | Ipsum | 10 | |
| 456 | Dolor | 2 | 2 |