I've got two numpy arrays, with shapes something like:

`A = (2000, 2000, 3)`
and
`B = (2000, 2000, 4)`

I also have an array of indices, let's say `[1,3]`

What I need to do is take the two original arrays, and create a new array that is `(2000, 2000, 5)` where each inner array is the entire contents of A's inner array, and the specified indices of B's.

So an inner array might be:

`(A[0], A[1], A[2], B[1], B[3])`

I'm currently doing this directly in Python, like this:

```
width = 2000
height = 2000
out_data = np.empty((height, width, 5), np.float32)
for y in range(height):
    for x in range(width):
        out_data[y][x][:3] = A[y][x]
        out_data[y][x][3] = B[y][x][1]
        out_data[y][x][4] = B[y][x][3]

```

This is very slow. What I'm wondering is if there's a better way that I can do this within numpy?

If there's a way to do this by extending `A`, I am happy with that, as `A` and `B` are only used for this purpose.