I have arrays of size A (1, 1, 59)
and B (1, 95, 59)
. I want to concatenate the arrays. The size of the array should be (1, 96, 59)
.
np.concatenate((A, B),axis =0)
Doesn't work. The error is ValueError: all the input array dimensions except for the concatenation axis must match exactly
The axis is incorrect:
>>> import numpy as np
>>> A = np.ones((1,1,59))
>>> B = np.zeros((1,56,59))
>>> np.concatenate((A, B), axis=1)
array([[[ 1., 1., 1., ..., 1., 1., 1.],
[ 0., 0., 0., ..., 0., 0., 0.],
[ 0., 0., 0., ..., 0., 0., 0.],
...,
[ 0., 0., 0., ..., 0., 0., 0.],
[ 0., 0., 0., ..., 0., 0., 0.],
[ 0., 0., 0., ..., 0., 0., 0.]]])
>>> _.shape
(1, 57, 59)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With