#5 Multiple Plots .loc Not Working

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"])

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?

I believe the shortcut unrate[0:12] actually translates into the dataframe.iloc call to give the first 12 rows by position along with all of the columns. Alternatively, dataframe.loc scans the pandas dataframe index(es) to find the rows with index values that match the passed-in values.