I have a Python list created with fuzzywuzzy
result=[(fuzz.WRatio(n, n2),n2,sdf.index[x],bdf.index[y])
for y, n2 in enumerate(Col2['name']) if fuzz.WRatio(n, n2)>70 and len(n2) >= 2]
print('Result: {}'.format(result))
which will produce the following result:
String to compare to raw data: ABC
Result: [(90, u'ABC COMPANY', 21636, 100079), (86, u'ABC COMPANY CO', 21636, 72933), (86, u'ABC (M) SDN BHD', 21636, 92592), (95, u'ABC PTE LTD.', 21636, 171968)]
I would like to be able to sort the whole list by the first digit of each array in descending order. I have tried using
result.sort()
which doesn't sort the list in descending order, any idea?