Concatenating two multi-dimensional numpy arrays at specific index
I have two numpy arrays of sizes: [20,3,100,100] and [20,5,100,100].
They are 20 (100,100) images with 3 channels, and 5 channels, respectively. I want to concatenate the channels so that I have 20 (100,100) images with 8 channels.
I would like to concat them along (dim = 1) them together, without having to create a new numpy.zeros array of size [20,8,100,100]. Is this possible?

Concatenate merges arrays along an existing axis:
import numpy as np

a = np.zeros((20,3,100,100))
b = np.ones((20,5,100,100))
output = np.concatenate((a,b), axis=1)

output.shape
# (20, 8, 100, 100)

