1

I am trying to input this command:

example = pd.read_excel('080615_gene_expression.xlsx' , index_col = 0)

but I get this error:

-bash: syntax error near unexpected token `('

I have tried changing quotes, spaces etc = no change

The command works in IPython 3.0.0.

3
  • Are you sure you are typing the command inside a python / ipython shell? it sounds like you are typing it into a bash shell instead. Aug 14, 2015 at 0:22
  • I solved it. AND YES you were correct! Rookie starting out here. Thanks!
    – Cris_Mar
    Aug 14, 2015 at 0:45
  • As you're a new user: if you found an answer to your question, don't forget to click the grey ☑ under the "0" to the left of it to accept it, which means "yes, this answer is valid"! Aug 15, 2015 at 9:03

2 Answers 2

1

If I start your command in a bash, I get an interesting

bash: syntax error near unexpected token `('

Start a Python interpreter by typing pythonEnter and then try the command again ;)


In my case, I get a

IOError: [Errno 2] No such file or directory: '080615_gene_expression.xlsx'

but in my case that's absolutely normal as I don't have your excel sheet.

0

This is a Python command, not a Bash command. You can run a Python shell and then run your code by hand by typing:

ipython

If you get an error that ipython command was not found, install it via:

pip install ipython

If you're putting this into a script and trying to run it from the shell, your Python script needs to start with (first line of the file):

#!/usr/bin/env python

Then you can run it from Bash as:

chmod +x my_script
./my_script.py

Not the answer you're looking for? Browse other questions tagged .