0

I try to calculate the polarity of the column "Review Gast" based on the if-condition that the value in the column "Food" needs to be "True". This is my code:

from textblob import TextBlob
if reviews_english['Food'] == True:
    reviews_english['Polarity Food'] = reviews_english['Review Gast'].map(lambda text: TextBlob(text).sentiment.polarity)

However the following error occurs:

"ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all()."

What am I doing wrong?

quamrana
  • 33,740
  • 12
  • 54
  • 68
  • https://stackoverflow.com/questions/36921951/truth-value-of-a-series-is-ambiguous-use-a-empty-a-bool-a-item-a-any-o possible duplicate? – schullzroll Jun 19 '21 at 10:00

0 Answers0