1

I have problem in reading excel file from location.

Error

File "c:\users\dominic\appdata\local\programs\python\python37-32\lib\site-packages\xlrd\__init__.py", line 1187
    print "EXTERNSHEET(b7-):"
                            ^
SyntaxError: invalid syntax

Syntax

import pandas as pd

df = pd.read_excel('DumpData 2.xlsx', sheet_name=None)

Kindly help to resolve the problem above

dominic tanui
  • 21
  • 1
  • 8

1 Answers1

2

You can try below syntax for python-3:

import pandas as pd

df = pd.read_excel (r'Path where the Excel file is stored\File name.xlsx', sheet_name='your Excel sheet name')
print (df)

Also, you can try to upgrade the XLRD for python-3

python3 -m pip install --upgrade xlrd

I have Python 3 and Pandas 0.23.4 and it's working fine. Just check your pandas version using print(pd.__version__) and try to upgrade it.

If it doesn't work try to reinstall the pandas & XLRD module using pip

Vijesh
  • 795
  • 3
  • 9
  • 23