Unpacking the resulting list of tuples into a comma-separated values.
Using FuzzyWuzzy, I am comparing 2 files and want to output the results into a 3rd file.
Building out from this SO question: Python: Keepning only the outerloop max result when comparing string similarity of two lists
The output is:
[('Item_number', ('Item number', 91)), ('Item', ('Item name', 62))]
Using this unpack method,I was able to separate the values:
for i in mapper:
print(*[i[0]],*[*i[1]])
Output:
Item_number Item number 91
Item Item name 62
Now, here is where I fall short. I am looking for the individual values to be comma-separated in order to be saved to a CSV file.
I tested many other solutions such as itertools but without success such as:
[('I', 't', 'e', 'm', '_', 'n', 'u', 'm', 'b', 'e', 'r', 'Item number', 91), ('I', 't', 'e', 'm', 'Item name', 62)]
Expected output:
Item_number, Item number, 91
Item, Item name, 62
Note: I am not looking for itertool specific solution but rather a solution that make sense.
Thanks for your interest.