I have a list of sentences as follows
pylist=['This is an apple', 'This is an orange', 'The pineapple is yellow','A grape is red']
If I define a stopwords list such as
stopwords=['This', 'is', 'an', 'The']
Is there a way for me to apply this to the entire list such that my output is
pylist=['apple','orange','pineapple is yellow','A grape is red']
PS: I tried to use apply with a function defined to remove stopwords like [removewords(x) for x in pylist] but wasn't successful (plus not sure if this is the most efficient way).
Thanks!