I am currently stuck on this part of my guided project on “Finding Heavy Traffic Indicators on I-94” and seem not to be able to figure out the error.*
My code:
plt.figure(figsize = (10,5))
time_of_the_day = [daytime, nighttime]
for i, day in zip(range(1,3), time_of_the_day):
plt.subplot(1,2,i)
plt.hist(day['traffic_volume'])
plt.title(day)
plt.xlabel('Traffic Vol')
plt.ylabel('Freq')
plt.xlim([-100,7000])
plt.ylim([1,8000])
plt.show()
I noticed that when I run it without commenting on the line of .title(), it generates the error which is pointed out in the error message
However, when I do otherwise that is, comment on the aforementioned line, it runs without an error
Please can someone kindly explain this. Thank you in advance.