Please Use map()
python function.
Input: In case of list of values
index = [u'CARBO1004' u'CARBO1006' u'CARBO1008' u'CARBO1009' u'CARBO1020']
encoded_string = map(str, index)
Output: ['CARBO1004', 'CARBO1006', 'CARBO1008', 'CARBO1009', 'CARBO1020']
For a Single string input:
index = u'CARBO1004'
# Use Any one of the encoding scheme.
index.encode("utf-8") # To utf-8 encoding scheme
index.encode('ascii', 'ignore') # To Ignore Encoding Errors and set to default scheme
Output: 'CARBO1004'