Trying to find the percentage of people with a Bachelors degree. I’ve come up with a several different ways to do this, most of which work when I try it on kaggle. But no matter which way I’ve tried on repl.it, it brings up an error. I’m sure this is going to be something really simple…
Thanks for the help!
https://repl.it/@thepaperrose/boilerplate-demographic-data-analyzer#demographic_data_analyzer.py
Your code so far
percentage_bachelors = round(df[df[‘education’] == ‘Bachelors’].shape[0] / df.shape[0]*100, 1)
The error I get
Traceback (most recent call last):
File “main.py”, line 2, in
import demographic_data_analyzer
File “/home/runner/boilerplate-demographic-data-analyzer/demographic_data_analyzer.py”, line 17
percentage_bachelors = round(df[df[‘education’] == ‘Bachelors’].shape[0] / df.shape[0]*100, 1) # round(len(df[df[‘education’] == ‘Bachelors’) / len(df) * 100, 1)
^
SyntaxError: invalid syntax
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36
.
Challenge: Demographic Data Analyzer
Link to the challenge: