I have a 2D array in a format of (image, ID) , where some images have the same ID. For example:
data_2d = [(image1, 1) , (image2, 2),(image3, 2) , image(4, 2) , (image5,3), (image6,3)]
Now my goal is to convert this to a 3D array using their id numbers. To be more clear:
data_3d = [[(image1, 1) ] , [(image2, 2),(image3, 2) , image(4, 2)] , [(image5,3), (image6,3)]]
Is there a way to this?