I have a csv file that contains the following: the date a tweet is published, the sentiment value (0=negative and 1=positive), and then the tweet in the third column, all seperated by commas.
I need to plot the date on the x-axis and the sentiment value on the y-axis to see the change of tweets sentiment as time passes. the file looks like this
Date,SA,Tweet,
2009-06-11,0, No Post Title,
2009-06-11,0, No Post Title,
2009-06-11,0, No Post Title,
2009-06-11,0, No Post Title,
2009-06-11,0, No Post Title,
2009-06-11,0, No Post Title,
2009-06-11,0, No Post Title,
2009-06-11,0, No Post Title,
2009-06-12,0, No Post Title,
2009-06-12,0, No Post Title,
2009-06-12,0, No Post Title,
2009-06-12,0, No Post Title,
What I have tried:
I have searched many sites and run many codes but nothing seems to work.
I thought of using time series but i dont know the correct way
A sample code i used(which i am sure is wrong):
import pandas as pd
import plot_utils as pu
df = pd.read_csv('SA.csv', index_col=0)
pu.plot_timeseries(df['SA'], ylabel='Unit: %', title='Sentiment anaylsis variation')
I get this error:
ValueError: Unknown string format
and an empty graph
I followed the following post:
https://github.com/jsh9/python-plot-utilities