Data Analysis Project : Demographic Data Analyzer Error "What country has the highest percentage of people that earn >50K?"

So when I wrote out the code, it shows a red line under it. : new_df = df.loc[(df[“salary”] == “>50K”)][“native-country”].value_counts()

Here’s the error I get:
File “/home/runner/boilerplate-demographic-data-analyzer-3/”, line 48
new_df = df.loc[(df[“salary”] == “>50K”)][“native-country”].value_counts()
SyntaxError: invalid syntax
exit status 1

I don’t know how syntax error I’m making, I would appreciate it if anyone can lend a hand at this.

Well that means the error happens BEFORE that line - most likely a missing symbol to signify the end of a command.
The interpreter just runs into the error at that point, because it’s waiting for the EOC.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.