Question: Why will this code not run in Python? (I already imported all packages needed and the dataset that it's from). Python keeps telling me there
Why will this code not run in Python? (I already imported all packages needed and the dataset that it's from). Python keeps telling me there is an error with the third to last
and second to last lines.
# Do higher income counties (those above the 80th income percentile) perform better or worse academically? # Answer this question by comparing them to the bottom 20th percentile. # Produce a bar chart to summarize your findings. Make sure to label the axis correctly and to add a title.
high_income_counties = np.percentile(CASchools.income, 80) high_income_counties = CASchools.income[CASchools.income >= high_income_counties]
low_income_counties = np.percentile(CASchools.income, 20) low_income_counties = CASchools.income[CASchools.income <= low_income_counties]
CASchools["high_or_low_income"] = "" CASchools.loc[(CASchools.income >= high_income_counties), "high_or_low_income"] = "high income" CASchools.loc[(CASchools.income <= low_income_counties), "high_or_low_income"] = "low income" CASchools.head(420)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
