Guided Project: Gender Gap/College Degrees

Could somebody please help me understand the following code where it says the following in the Solutions:

Generate first column of line charts. STEM degrees.

for sp in range(0,18,3):
cat_index = int(sp/3)

Generate second column of line charts. Liberal arts degrees.

for sp in range(1,16,3):
cat_index = int((sp-1)/3)

Generate third column of line charts. Other degrees.

for sp in range(2,20,3):
cat_index = int((sp-2)/3)

Thanks!

1 Like

Hi @desideriojeremy,

This post will help you to understand it:

Best,
Sahil

Thanks Sahil. Very helpful!

1 Like