I am trying to compile a python list based on first elements of nested list. But I am not sure what is the correct way to do that.
I have this nested list.
list1 = [[1, a, b, c], [2, b, c, d], [2, b, d, e], [1, c, a, d]]
I am trying to get an output like this.
output_list = [[1, [a, b, c], [c, a, d]], [2, [b, c, d], [b, d, e]]]