Welcome to the CSC Q&A.
Get help and give help!
Write great code!
It is our choices... that show what we truly are, far more than our abilities.


+5 votes

I'm having trouble with passing in the tweets for my sentiment analyzer. It works fine, but I would like it to read through the tweets in the .csv file, and I'm stuck at the moment.

asked in CSC320 by (2k points)

2 Answers

+2 votes

You can use this statement file = pd.read_csv(fileName, lineterminator='\n') provided by Dr. Stonedahl in one of his emails. You will need to import pandas as pd for that one to work.

answered by (2.1k points)

I've used that code, but I think I may have done it incorrectly. I'll try it again. Thanks!

0 votes

You should let pandas read the csv file first. Then you can put the tweets in a list and use a for loop to read them all. Does that answer your question?

answered by (1.1k points)