Stack Overflow Asked by San22 on November 24, 2021
I am using IMDB reviews dataset containing two columns – sentiment and review. I am trying to convert the review column to a list so as to perform loop operations but when I assign my series(review column) to a variable and print the variable, the output shows nothing. When I separately print df['review'].values.tolist()
without assigning to any variable, it correctly outputs a list.
I can't reproduce your problem but you can probably solve it simply by improving your code.
review
Basically, your code should look like this:
def parse_sentence(sentence):
sentence = sentence.lower()
sentence = re.sub(pattern, '', sentence)
...
return sentence
clean_reviews = df["review"].map(parse_sentence)
print(clean_review)
Answered by qmeeus on November 24, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP