I got two numpy arrays in three dimensions. I need it to concatendate it with other numpy array so that the resulting array has four dimensions. In Matlab, this can be performed via cat(4,a,b), but how to do the same using numpy in python.

Like

```a = one((1,2,3))
b = one ((1,2,3))
c= concatenate((a,b), axis=3)```

Just to clarify, I want c[:,:,:,0] and c[:,:,:,1] to correspond with the a and b.

Aug 1, 2022 in Python 421 views

## What is the easiest way to concatenate two lists in Python?

You can use the + operator to combine them: list1 ...READ MORE

## How do you get the logical xor of two variables in Python?

What i found is that you can use ...READ MORE

## In NumPy how do I get the maximum of subsets? Python

You can use np.maximum.reduceat: >>> _, idx = np.unique(g, ...READ MORE

## What's the right way to concatenate files and appending the New Line character in Python? Text or binary mode?

It seems like you're using the wrong ...READ MORE

+1 vote

## View onto a numpy array?

just index it as you normally would. ...READ MORE

## Dimension in python numpy

Use the .shape to print the dimensions ...READ MORE