Hello everybody,
Is there a way to sort out all strings from the following list based on the double numerical values?
In the end, each “variant” should only exist once.
Thanks in advance!
Hello everybody,
Is there a way to sort out all strings from the following list based on the double numerical values?
In the end, each “variant” should only exist once.
Thanks in advance!
Many Thanks! That’s exactly what I needed!
But how can I set the @Lx in the “List.LastItem” and “List.UniqueItems” block? This possibility does not exist for me …
can you show an image ?
try to expand the little arrow in right side and set to level2…hope it helps
Hello
another solution
import sys
import re
listA = IN[0]
if all(re.search(r'(\d+[\,\.]\d+)', x) is not None for x in listA):
listA.sort(key = lambda x : float(re.search(r'(\d+\.\d+)', x.replace(',','.')).group(1)))
OUT = listA
Thanks that was the mistake. It works.
Yes @c.poupin great way too…your old python shark
Thanks for your solution. This will sort the values in pairs, right? I think it would work because I can now remove every second value.
the code sort list string by decimal value
a small change has been made