Set a column in numpy array to zero
<p>I want to set a column in numpy array to zero at different times, in other words, I have numpy array <code>M</code> with size 5000x500. When I enter shape command the result is (5000,500), I think 5000 are rows and 500 are columns </p>

<pre><code>shape(M)
(5000,500)
</code></pre>

<p>But the problem when I want to access one column like first column</p>

<pre><code>Mcol=M[:][0]
</code></pre>

<p>Then I check by shape again with new matrix <code>Mcol</code></p>

<pre><code>shape(Mcol)
(500,)
</code></pre>

<p>I expected the results will be (5000,) as the first has 5000 rows. Even when changed the operation the result was the same</p>

<pre><code>shape(M)
(5000,500)
Mcol=M[0][:]
shape(Mcol)
(500,)
</code></pre>

<p>Any help please in explaining what happens in my code and if the following operation is right to set one column to zero</p>

<pre><code>M[:][0]=0
</code></pre>