Screen Link: Learn data science with Python and R projects
At this point in the Guided Project, we are shown how to find the amount of helicopter prison break attempts per year. We are shown how to create a for loop within a for loop and the mechanics are throwing me off.
for ya in attempts_per_year: # Instruction 2 - nothing to do here # Instruction 3 - assign the year value in ya to y if row == y: ya += 1
What I expected to happen:
I am just confused as to what is going on in general. From what I understand we are seeing when the year attempted in the Data loop matches the year attempted in the attempts per year loop and then incrementing the attempts whenever they match up.
There is a lot going on and is a bit overwhelming at the moment, but what do I put in #instruction #3 and how does this fit into our overall goal of incrementing years_attempted?
Thank you in advance.