How to concatenate these numpy
arrays?
first np.array
with a shape (5,4)
[[ 6487 400 489580 0]
[ 6488
You can do something like this.
import numpy as np
x = np.random.randint(100, size=(5, 4))
y = [16, 15, 12, 12, 17]
print(x)
val = np.concatenate((x,np.reshape(y,(x.shape[0],1))),axis=1)
print(val)
This outputs:
[[32 37 35 53]
[64 23 95 76]
[17 76 11 30]
[35 42 6 80]
[61 88 7 56]]
[[32 37 35 53 16]
[64 23 95 76 15]
[17 76 11 30 12]
[35 42 6 80 12]
[61 88 7 56 17]]