python read xls

Solutions on MaxInterview for python read xls by the best coders in the world

showing results for - "python read xls"
Emanuele
16 Apr 2019
1# credit to Stack Overflow user in the source link
2
3import pandas as pd
4
5# use r before absolute file path
6xls = pd.ExcelFile(r"yourfilename.xls")  
7
8# 2 is the sheet number+1 thus 
9# if the file has only 1 sheet write 0 in paranthesis
10sheetX = xls.parse(2) 
11var1 = sheetX['ColumnName']
12
13# 1 is the row number
14print(var1[1])