I am calculating higher_education_rich by doing:
higher_education =df[df[“education”].isin([‘Bachelors’,‘Masters’,‘Doctorates’])]
higher_education_r = df[(df[“education”].isin([‘Bachelors’,‘Masters’,‘Doctorates’])) & (df[‘salary’]==’>50K’)]
higher_education_rich = round((len(higher_education_r)*100)/(len(higher_education)),1)
and I obtain a value of 44.9 , not the 46.5 expected.
And for the lower_education_rich I obtain 18.3, not 17.4 as expected… For this variable I am doing:
lower_education=df[~df[“education”].isin([‘Bachelors’,‘Masters’,‘Doctorates’])]
lower_education_rich = round(len(lower_education [lower_education.salary==’>50K’])*100/len(lower_education),1)
I can’t detect what I am doing wrong… Can you help me?
project link:
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.85 Safari/537.36
.
Challenge: Demographic Data Analyzer
Link to the challenge: