📜  python 读取 xls - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:49.429000             🧑  作者: Mango

代码示例1
# credit to Stack Overflow user in the source link

import pandas as pd

# use r before absolute file path
xls = pd.ExcelFile(r"yourfilename.xls")  

# 2 is the sheet number+1 thus 
# if the file has only 1 sheet write 0 in paranthesis
sheetX = xls.parse(2) 
var1 = sheetX['ColumnName']

# 1 is the row number
print(var1[1])