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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!