import matplotlib.pyplot as plt fig = plt.figure(figsize=(10,6)) colors = ['red', 'blue', 'green', 'orange', 'black'] years=[1948,1949,1950,1951,1952] for i in range(5): start_index = i*12 end_index = (i+1)*12 subset = unrate[start_index:end_index] # plt.plot(subset['MONTH'], subset['VALUE'], c=colors[i],label=str(years[i])) plt.plot(subset['MONTH'], subset['VALUE'], c=colors[i],label=str(1948+i)) plt.legend(loc="upper left") plt.show()
What I expected to happen:
The output is exactly the same as the actual answer therefore, it should not show any error on the submission.
What actually happened:
Your 1st plot doesn't match what we expected.
On submission, it shows the error above. I tried with both the plt.plot() ways as mentioned in the code but the error still remains. If this is because of