Error Generated: UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 0: ordinal not in range(128)
Data Example:
2014-08-06 7:00,4.06E+04,42878.05892
2014-08-06 8:00,4.40E+04,42857.00667
I followed this accepted answer but haven't had any luck making it work: timestamps passed to matplotlib.date2num: 'str' object has no attribute 'toordinal'
Code:
timeformat = '%Y-%m-%d %H:%M'
columns = ["Datetime","Prediction","Actual"]
dtypes = ["object","float","float"]
myResults1 = np.genfromtxt("/Users/project/results_1.csv", delimiter=",", names=columns, dtype=dtypes)
time = [datetime.strptime(i,timeformat) for i in myResults1['Datetime']]
predictions = myResults1['Prediction']
actual = myResults1['Actual']
fig = pyplot.figure()
ax1 = fig.add_subplot(3,2,1,axisbg='grey')
ax1.plot_date(time,predictions)
ax1.set_xlabel('Time')
ax1.set_ylabel('Prediction')
pyplot.setp(ax1.xaxis.get_majorticklabels(),rotation=25)
Thanks anyone who can help!!