Suppose we have values in query column of a panda data frame which are tokenized using the split() function like
query[4] = "['rain', 'shower', 'head']".
Now I want to perform some operations on individual words. So, I converted it into list and iterated through it using for loop like like :
l=list(query[4])
for word in l : word=func(word)
But it is storing each alphabets on the list like - ['[', "'", 'r', 'a', 'i', 'n', "'", ','
and so on.
I have even tried to use join function i.e. - ''.join(word)
and ''.join(l)
But still nothing is working for me. Can you suggest something here. Any help will be appreciated.