Às 22:21 de 21/04/19, Paul Rubin escreveu:
> Paulo da Silva <p_s_d_a_s_i_l_v_a...@netcabo.pt> writes:
>> splitter={}
>> for f in Objs:
>>      splitter.setdefault(f.getId1,[]).append(f)
>> groups=[gs for gs in splitter.values() if len(gs)>1]
> 
> It's easiest if you can sort the input list and then use
> itertools.groupby.
Yes, sort and groupby seems the best way to go.
Thanks.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to