In #5 of the Multiple Plots section of the Data Science Track, we are asked to create 2 line subplots in a 2 row by 1 column layout. The code that I wrote to answer the question is the following:
fig = plt.figure()
ax1 = fig.add_subplot(2,1,1)
ax2 = fig.add_subplot(2,1,2)
ax1.plot(unrate.loc[0:12,"DATE"], unrate.loc[0:12,"VALUE"])
ax2.plot(unrate.loc[12:24,"DATE"], unrate.loc[12:24,"VALUE"])
plt.show()
However, the correct answer would only allow me to submit the ax1 and ax2 plots as the following:
ax1.plot(unrate[0:12]['DATE'], unrate[0:12]['VALUE'])
ax2.plot(unrate[12:24]['DATE'], unrate[12:24]['VALUE'])
I thought that unrate[0:12][‘DATE’] was the same as unrate.loc[0:12,“DATE”]? Am I missing something here?