I've tried the following, which doesn't work, because I'm not sure how to apply groupby or sorted to a Dictionary.
from itertools import groupby
from operator import itemgetter
Desired_List = [list(grp) for key, grp in itertools.groupby(sorted(lst, key=operator.itemgetter(['ID'])),key=operator.itemgetter(['ID'))]
Lösung
I think the issue with your current code is how you're calling itemgetter. The arguments should be the keys to use to access the object, without any container. You're passing a list, which isn't a legal dictionary key. Try:
keyfunc = operator.itemgetter("ID")
Desired_List = [list(grp) for key, grp in itertools.groupby(sorted(lst, key=keyfunc),
key=keyfunc)]