title: Comparing by section two numpy arrays in python
body: <p>I want to do a comparison between the two arrays by section.
  so far I have to get results for all arrays.</p>
  
  <pre><code>import numpy as np
  array1 = np.array(list(np.zeros(20))+(list(np.ones(20)))+(list(2*np.ones(20))))
  array2 = np.array(list(np.ones(20))+(list(np.ones(20)))+(list(3*np.ones(20))))
  result = np.sum(array1 == array2)
  print 'all result :' + str(result)
  </code></pre>
  
  <p>how to can result in parts, such as the first data 20 then 20 the second data and 20 third data in the array??
  the result should be:</p>
  
  <p>all result : 20</p>
  
  <p>result for 20 firt data : 0</p>
  
  <p>result for 20 second data : 20</p>
  
  <p>result for 20 third data : 0</p>