My issue is little bit strange. I have an excel file in which some float values are mentioned e.g. 0.0079 but when I try to read it using my code it's giving me 0.007899999999999999. I'm not sure what's actually happening here(may be that's the original data which was entered in the excel sheet when it was originally created). I checked other questions on SO which are similar but they are all concerned about 'how to not loose the precision' and my case is opposite.
sample code:
sheet_hdl = open_workbook('file.xls')
sheet = sheet_hdl.sheet_by_index(0)
for row_idx in range(1, sheet.nrows):
for col_idx in range(1):
if(val == str(sheet.cell(row_idx,col_idx + 1).value)):
accuracy_val = repr(sheet.cell(row_idx,col_idx + 7).value)
print(accuracy_val)
Note: It's not a duplicate of this. The question in this link involves computation, but my data in excel doesn't involve any computations.