title: How do I count the occurrence of a certain item in an ndarray?
body: <p>How do I count the number of <code>0</code>s and <code>1</code>s in the following array?</p>
  <pre><code>y = np.array([0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1])
  </code></pre>
  <hr />
  <p><code>y.count(0)</code> gives:</p>
  <blockquote>
  <p><code>numpy.ndarray</code> object has no attribute <code>count</code></p>
  </blockquote>