I have the following list:
result = [{"{'rueda-pinchada', 'rueda-repuesto'}", " {'eje', 'maletero', 'suelo'}"}]
and I want to get the following:
result = [{'rueda-repuesto', 'rueda-pinchada'}, {'maletero', 'eje', 'suelo'}]
As you can see, the second list contains two sets, while the first contains a set with two strings that "mimic" a set. The idea is to flatten the list to get the two strings, and with the list of strings, convert these to set. Remaining a list of sets.
I have tried to flatten it as follows:
aux = [constante for x in result for constante in x]
and has resulted in:
['{', "'", 'r', 'u', 'e', 'd', 'a', '-', 'p', 'i', 'n', 'c', 'h', 'a', 'd', 'a', "'", ',', ' ', "'", 'r', 'u', 'e', 'd', 'a', '-', 'r', 'e', 'p', 'u', 'e', 's', 't', 'o', "'", '}', ' ', '{', "'", 'e', 'j', 'e', "'", ',', ' ', "'", 'm', 'a', 'l', 'e', 't', 'e', 'r', 'o', "'", ',', ' ', "'", 's', 'u', 'e', 'l', 'o', "'", '}']