I have a dataframe that looks like this:
fruit cost
apples 2
oranges 3
bananas 5
grapefruit 1
I want to pass a list that includes specified "fruit" column values and use that to duplicate those rows in the dataframe. For example, duplicated fruits = ['apples', 'oranges']
.
These rows should then be copied back into the dataframe with an extra column that denotes that they are a copy (can be a binary 1/0).