You can use string encoding to convert the unicode
to ascii
. So your updated code should be
column_headers.append((sheet.cell(row_number, column_number).value).encode('ascii','ignore'))
You can get the value by using data.value
for the content of the field name. Also note that integers
are imported as floats
by default. So, you may end with with an additional .0
in the end, which you can remove by typecasting the value by using int(data.value)
.