Did we talk about range() before? And the instruction does not explain

I saw a post before saying that the course did not mention the range() function unit this chapter came. DQ replied that they would fix it. but I don’t think the problem get fixed yet.

The instruction has below sample but did not explain it in detail, just ask us to follow the step to type the code. Can DQ try to make the instruction more clear instead of just throwing a sample and asking us to type the code?

Thank you!

fig = plt.figure(figsize=(12,5))

for i in range(2):
    ax = fig.add_subplot(2,1,i+1)
    start_index = i*12
    end_index = (i+1)*12
    subset = unrate[start_index:end_index]
    ax.plot(subset['DATE'], subset['VALUE'])

plt.show()

Hi @candiceliu93

I don’t remember if there’s any mention of range() before or during the course you’re right now. But i’m pretty sure that they mentioned in the python fundamentals course when they explain about for loops. I mean, range is one of the basic and one of the most important functions in for loops.

Now, even if they haven’t mentioned something about this function, you should check the python documentation (or different websites were you can find explanation about it, like w3schools) in case you don’t understand some basic concepts and functions, what’s more, one of the most important things you should do is read not only the python documentation, but pandas’ and matplotlib’s docs.

1 Like

range generates a list of numbers with a start, stop and step (which is optional). If you are unsure of what a function does take that function name and put into google and it will lead you to what you need (in this case the python docs)

A word of caution on pandas and matplotlib docs though as dataquest may use different versions but the fundamentals are mostly the same

pandas is at 1.0.5 and matplotlib is at 3.2.2 as of now so that is something to keep in mind