I haves been looking for an answer to this but can't seem to find anything that does this elegantly or pythonic.
Basically if I have a list:
A = [["1a", "ab"], ["2b", "cd"], ["1a", "ef"]]
I want to identify every item which has the same value in their first index and if that's the case amend the list so that A becomes:
A = [["1a", ["ab", "ef"]], ["2b", "cd"]]
As ordering is important I am trying to avoid dictionaries.