After splitting my dataset into train, test, and validation sets I have a x_validation set which is a set of strings. Calling x_validation.head() gives:
0 this drink is making my throat hurt more and need to convince corey to go to jacks mannequin concert obvs will be in need of advil
1 there gonna be movie on no can see it not even the trailers hate thinking about it as it is ll have breakdown
2 the wire on my braces is too long and is cutting through my cheek farrrrrrrk it hurts
3 finally have uploaded my documentary to an external site message me for link and password
4 lovely national day today hour children parade and hour citizens parade with ju jitsu training
It has something like 15,000 strings total. I'm trying to create a new list tbresult containing the sentiment polarity scores of each string as calculated by TextBlob:
tbresult = [TextBlob(i).sentiment.polarity for i in x_validation]
This gives me the following error:
TypeError: The `text` argument passed to `__init__(text)` must be a string, not <class 'float'>
I'm confused because when I do the following,
lst = [x for x in x_validation]
TextBlob(lst[0]).sentiment.polarity
it works, I get 0.5. I'm confused where this float type is coming from in the error. How do I do this properly?