I think a kind of code that wasn’t taught was used in an exercise’s solution.
If that’s the case that would be frustrating.
Also, after too many hours of searching for answers about it, I think the kind of code that was used in the solution is often discouraged (and that might be why I had such a hard time finding any documentation explaining it).
I hope my trouble has some use, maybe for DQ in reviewing their teaching materials. I’d be glad to be corrected about anything I’ve thought.
Thanks for your work.
Screen Link: https://app.dataquest.io/m/143/multiple-plots/5/adding-data
The solution code in question on that step 5 of mission 143:
fig = plt.figure()
ax1 = fig.add_subplot(2,1,1)
ax2 = fig.add_subplot(2,1,2)
ax1.plot(unrate[0:12]['DATE'], unrate[0:12]['VALUE']) # chained indexing
ax2.plot(unrate[12:24]['DATE'], unrate[12:24]['VALUE']) # here too?
plt.show()
I’m still practicing getting better at searching for explanations, including trying to get something out of official documentation for code sets like pandas or numpy. I went to the pandas site, eventually hit the user guide, saw “indexing and selecting data” as the second subheading on the left margin, then browsed the whole very long page, looking for something that matched the kind of indexing I saw in the solution for 143-5.
I found out about “chained indexing” at the bottom of the page, in the last subheading there, which you can get to by clicking on the last subheading on the right margin of the page, or going straight to:
https://pandas.pydata.org/docs/user_guide/indexing.html#returning-a-view-versus-a-copy
Anyway, it feels good to share my progress in difficult things, so thanks, again, for reading all this.