How to Group Same Value of List in the Pictute…
Read up on how to use GroupByKey
GroupByKey return result not like picture
liste = IN from collections import OrderedDict unique = list(OrderedDict.fromkeys(liste)) output =  for i in unique: temp =  for j in liste: if j ==i: temp.append(j) output.append(temp) OUT = output
Can group in the picture…?
group by key node resolves the job, creating a dictionary by keys as well
@Eng.Minh Try this:
from itertools import groupby OUT = [list(groups) for keyValue,groups in groupby(IN)]
Is the idea to group values that are the same consecutively?
As long as the value is the same it’s in the same list, once it changes you need another list and so on?
Thank @AmolShah , it worked fine.
Yes, it is my idea, i need group to count amount of detector and replace by annotation in the picture
I like your coding skills,
bcoz i got same solution by writing 20-25 lines of code and you got it in 2 line.