Skip to content Skip to sidebar Skip to footer

Python: Read A Percentage Value From Excel Using Xlrd

I am trying to read percentage value from excel using xlrd. but the output keeps coming as 1.0. Is there a way that I can load it as a percentage without the value being changed? B

Solution 1:

You could use pandas to convert the whole excel to a data frame, something like:

excel_dataframe = pd.read_excel(excel_file, sheet_name=s)

and then use a apply map to convert to string.

excel_dataframe = excel_dataframe.applymap(str)

This will convert all the cells in the excel to string, that way you get a string object and the correct value

Post a Comment for "Python: Read A Percentage Value From Excel Using Xlrd"