擅长:python、mysql、java
<p>你可以这样做。</p>
<pre><code>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)
</code></pre>
<p>这将输出:</p>
<pre><code>[[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]]
</code></pre>