I am a beginner in python, and I have the following (embarassing) issue:
I am trying to import an excel file using xlrd but I have the "FilenotfoundError".
Anyone is able to help a newbie?
Thanks a lot, Matteo
-- import xlrd
#load the data file path =(r"C:\Users\MCECCHI\Desktop\oil_exxon.xls")
wb = xlrd.open_workbook(path) sheet = wb.sheet_by_index(0)
print(sheet.nrows)
You should try to pip install xlrd and It can be done like this
import xlrd
loc = (r"C:\Users\MCECCHI\Desktop\oil_exxon.xls")
wb = xlrd.open_workbook(loc)
sheet = wb.sheet_by_index(0)
sheet.cell_value(0, 0)
print(sheet.nrows)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.