Closed kimkraunz closed 9 years ago
Pandas dataframe will return of 'Series' type. And you are trying to create a blob with that type instead of string. Error will be like:
The text
argument passed to __init__(text)
must be a string, not class 'pandas.core.series.Series'
Extract the element from the series and then try
I'm getting the following error when I try to use the sentiment property: The
text
argument passed to__init__(text)
must be a string, not <class 'pandas.core.series.Series'>I'm trying to run:
text = df['blurb'].apply(str) blob = TextBlob(text) sentiment= blob.sentiment
Can you please advise me how to pass a Series through TextBlob to do sentient analysis. The error seems to be coming from line 2. I've tried to write as a loop but I still get the same error.