As we can not have Data to reproduce, hence there might be different situation and different solutions.
I'm enlisting few situations which may lead you in a right direction...
Situation 1:
If you are using old python Version, then you should try simply below as its sheetname
with older version and sheet_name
with new version.
import pandas as pd
df = pd.read_excel(file_with_data, sheetname=sheet_with_data)
OR
You can use pd.ExcelFile
instead ..
xls = pd.ExcelFile('path_to_file.xls')
df1 = pd.read_excel(xls, 'in')
OR
xl = pd.ExcelFile(path)
# xl = pd.ExcelFile("Full_Path_of _file")
xl.sheet_names
[u'in', u'in1', u'in2']
df = xl.parse("in")
df.head()
OR
df = pd.read_excel(open('your_xls_xlsx_filename','rb'), sheet_name='Sheet 1')
# or using sheet index starting 0
df = pd.read_excel(open('your_xls_xlsx_filename','rb'), sheet_name=1)
Note: Opting sheetname argument needs be opted meticulously for python pandas version-wise>
For Older python Version: use sheetname
For New python version: use sheet_name
Situation 2:
Copy the address directly from the right-click file properties-security will cause this problem So, copying and pasting the file path also produce these issues while there is no other evident issues
solve
It has nothing to do with the backslash /forward slash in the path, and it has nothing to do with whether the path contains. There are two solutions
1 Enter the path manually
2 Open this path in Explorer, then copy
General reading convention:
# When the parameter is None, all tables are returned, which is a dictionary of tables;
sheet = pd.read_excel('example.xls',sheet_name= None)
# When the parameter is list = [0, 1, 2, 3], the returned multi-table is also a dictionary
sheet = pd.read_excel('example.xls',sheet_name= 0)
sheet = pd.read_excel('example.xls',sheet_name= [0,1])
#The data of the table can also be read according to the name of the table header or the position of the table
sheet = pd.read_excel('example.xls',sheet_name= 'Sheet0')
sheet = pd.read_excel('example.xls',sheet_name= ['Sheet0','Sheet1'])
sheet = pd.read_excel('example.xls',sheet_name=[0,1,'Sheet3'])