Skip to content
Advertisement

Read CSV File in Python: Syntax error near unexpected token `(‘

JavaScript

The error I get is: bash: syntax error near unexpected token `(‘

When I switch it to [] is get:

JavaScript

I’m unsure if I’m missing code or entering it incorrectly.

Advertisement

Answer

You’re trying to run python in the shell instead of in python.

Within the shell enter py, python or python3.

From there, do your normal python commands:

JavaScript

Produces

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement