Let's say I have a list of tuples currently sorted by the first element :
tuple_list = [(1, "hello", "apple"), (1, "no", "orange"),
(2, "bye", "grape"), (3, "okay", "banana"),
(4, "how are you?", "raisin"), (4, "I'm doing well", "watermelon")]
I want to turn this list of tuples into a list of list of tuples based on the first element of each tuple.
For example:
new_tuple_list = [[(1, "hello", "apple"), (1, "no", "orange")],
[(2, "bye", "grape")], [(3, "okay", "banana")],
[(4, "how are you?", "raisin"), (4, "I'm doing well", "watermelon")]]