title: How to iterate through a matrix column in python
body: <p>I have a matrix with the cell values only <code>0</code> or <code>1</code>.</p>
  
  <p>I want to count how many ones or zeros are there in the same row or column to a given cell.</p>
  
  <p>For example, the value <code>matrix[r][c]</code> is <code>1</code>, so I want to know how many ones are there in the same row. This code does that:</p>
  
  <pre><code>count_in_row = 0
  value = matrix[r][c]
  for i in matrix[r]:
      if i == value:
          count_in_row += 1
  </code></pre>
  
  <p>The for cycle iterates through the same row and counts all ones (cells with the same value).</p>
  
  <p>What if I want to do the same process with columns? Will I iterate through the whole matrix or it is possible through just one column?</p>
  
  <p>PS: I don't want to use <code>numpy</code>, <code>transpose</code> or <code>zip</code>; better with composite cycle.</p>