Visualizing The Gender Gap In College Degrees status Step 2 Not running as shown

for sp in range(0,19):
    ax = fig.add_subplot(6,3,(sp+1))
    if sp % 3 == 0:
        ax.plot(women_degrees['Year'], women_degrees[stem_cats[int((sp)/3)]], c=cb_dark_blue, label='Women', linewidth=3)
        ax.plot(women_degrees['Year'], 100-women_degrees[stem_cats[int((sp)/3)]], c=cb_orange, label='Men', linewidth=3)
    elif sp %3 == 1 and sp <= 14:
        ax.plot(women_degrees['Year'], women_degrees[lib_arts_cats[int((sp-1)/3)]], c=cb_dark_blue, label='Women', linewidth=3)
        ax.plot(women_degrees['Year'], 100-women_degrees[lib_arts_cats[int((sp-1)/3)]], c=cb_orange, label='Men', linewidth=3)
    elif sp % 3 == 2:
        ax.plot(women_degrees['Year'], women_degrees[other_cats[int((sp-2)/3)]], c=cb_dark_blue, label='Women', linewidth=3)
        ax.plot(women_degrees['Year'], 100-women_degrees[other_cats[int((sp-2)/3)]], c=cb_orange, label='Men', linewidth=3)

What I expected to happen: I wanted the column number 2 in 6th row to be blank. Is there any modification that i can do in the code that i have written above.

What actually happened: The column remained blank with an error.

The output is shown in image.


Hey there!

Any chance you can attach your notebook file here so we can get a closer look at the rest of your code?

I have attached my solution file. If possible just go through this.

I’m afraid that I’m not seeing the attached notebook file — the link itself would point to my DQ instance, not yours. Can you send the notebook file over so I can take a closer look?