Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+8 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 (1 point)

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 (1 point)
+1

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 point)
...