I have a data set of 1 million records as below
sample DF1:-
articles_urlToImage feed_status status keyword
hhtps://rqqkf.com untagged tag the apple,a mobile phone
hhtps://hqkf.com tagged ingore blackberry, the a phone
hhtps://hqkf.com untagged tag amazon, an shopping site
now I want to remove stopwords and some custom stopwords as below
custom stop words = ['phone','site'] (I have around 35 custom stop words)
expected out put
articles_urlToImage feed_status status keyword
hhtps://rqqkf.com untagged tag apple,mobile
hhtps://hqkf.com tagged ingore blackberry
hhtps://hqkf.com untagged tag amazon,shopping
I have tried to remove stopwords but I am getting below error
code
import nltk
import string
from nltk.corpus import stopwords
stop = stopwords.words('english')
df1['keyword'] = df1['keyword'].apply(lambda x: [item for item in x if item not in stop])
error
/usr/local/lib/python3.6/dist-packages/pandas/core/generic.py in __getattr__(self, name)
3612 if name in self._info_axis:
3613 return self[name]
-> 3614 return object.__getattribute__(self, name)
3615
3616 def __setattr__(self, name, value):
AttributeError: 'Series' object has no attribute 'split'