I know that you can specify data types when reading excels using pd.read_excel
(as outlined here). Can you do the same using pd.ExcelFile
?
I have the following code:
if ".xls" in
xl = pd.ExcelFile(path + "\\" + name, )
for sheet in xl.sheet_names:
xl_parsed = xl.parse(sheet)
When parsing the sheet, some of the values in the columns are displayed in scientific notation. I don't know the column names before loading so I need to import everything as string. Ideally I would like to be able to do something like xl_parsed = xl.parse(sheet, dtype = str)
. Any suggestions?