I have this list in Python
:
fruit = ['apple','grape','watermelon','pineapple']
And another list like that:
idx_list = [1,3]
Now, I need to match each value from idx_list
with the indexes in the fruit
to get a new list with values from fruit
list using list comprehension
.
Like this:
['grape','pineapple']
I'm trying to use this command [f for f in fruit.columns]
but I'm only getting the values from fruit.