I'm trying to figure out how to change an array such as:
a = np.array([[1,2,3],[4,5,6],[7,8,9]])
a.shape
(3,3)
into:
a = np.array([[[1,255,255],[2,255,255],[3,255,255]],
[4,255,255],[5,255,255],[6,255,255]],
[7,255,255],[8,255,255],[9,255,255]]])
a.shape
(3,3,3)
essentially turning a single element 1 into a [1, 255, 255]
I've played around with reshape but I can't seem to get the logic to do this without a slow for loop.