Converting 2D array into 3D by repeating same layer 3 times
I would use array[..., None].repeat(3, -1)
I have a 2d array of shape (512,512). I need to convert this to shape (512,512,3). All values of 2d dimension will be repeated on other two dims. How can I do this in python?