Good afternoon!
Long story short, I'm trying to do sentiment analysis on certain features of phones based on a review dataset. I'm coordinating this with a .loc function and it's worked before but this is a certain list instead of a string. I'm trying to link this to any x within a list, with the x being a list.
Here's what I have:
Battery = ['battery', 'charge', 'juice', 'talk time', 'hours', 'minutes']
batt = apple['Reviews'].str.lower().str.find(x in Battery)!=-1
The error returned is:
AttributeError: Can only use .str accessor with string values.
I did it this way because it did not like when I just put Battery instead of x in Battery.
Any suggestions? Thanks again!
The expected output would be, if I ran the variable assigned, are all rows that have any of the keywords. (The x within Battery). So any rows with anything like charge, juice, etc. would pop up.