I have a DataFrame like such:
id, fruit
1, apple
1, kiwi
2, melon
2, kiwi
3, mango
3, melon
3, mango
I have a Pandas Series like such:
id, fruit
1, apple
2, kiwi
3, mango
I want to filter my DataFrame such that for each row, its 'fruit' matches the corresponding value in the Series. For id=1, since fruit in series is apple, it filters only rows with fruit apple. For id=2, since fruit in series is kiwi, it filters only rows with fruit kiwi. For id=3, since fruit in series is mango, it filters only rows with fruit mango. I want:
id, fruit
1, apple
2, kiwi
3, mango
3, mango
Any suggestions?
*edit because it was incorrectly marked as an existing question.