擅长:python、mysql、java
<pre><code>x = np.random.rand(3,2)
x
Out[37]:
array([[ 0.03196827, 0.50048646],
[ 0.85928802, 0.50081615],
[ 0.11140678, 0.88828011]])
x = x[:,1]
x
Out[39]: array([ 0.50048646, 0.50081615, 0.88828011])
</code></pre>
<p>所以这一行做的是<a href="http://docs.scipy.org/doc/numpy-1.10.1/reference/arrays.indexing.html#basic-slicing-and-indexing">sliced</a>数组,取所有行(<code>:</code>),但保留第二列(<code>1</code>)</p>