title: Creating a subset of array from another array : Python
body: <p>I have a basic question regarding working with arrays:</p>
  
  <pre><code>a= ([ c b a a b b c a a b b c a a b a c b]) 
  b= ([ 0 1 0 1 0 0 0 0 2 0 1 0 2 0 0 1 0 1])
  </code></pre>
  
  <p>I) Is there a short way, to count the number of time  <code>'c'</code> in <code>a</code> corresponds to 0, 1, and 2 in <code>b</code> and <code>'b'</code> in <code>a</code> corresponds to 0, 1, 2 and so on </p>
  
  <p>II) How do I create a new array <code>c</code> (subset of <code>a</code>) and <code>d</code>(subset of <code>b</code>) such that it only contains those elements if the corresponding element in <code>a</code> is <code>'c'</code> ?</p>