title: Finding the consecutive zeros in a numpy array
body: <p>I have the following array</p>
  <pre class="lang-py prettyprint-override"><code>a = [1, 2, 3, 0, 0, 0, 0, 0, 0, 4, 5, 6, 0, 0, 0, 0, 9, 8, 7,0,10,11]
  </code></pre>
  <p>I would like to find the start and the end index of the array where the values are zeros consecutively. For the array above the output would be as follows</p>
  <pre class="lang-py prettyprint-override"><code>[3,8],[12,15],[19]
  </code></pre>
  <p>I want to achieve this as efficiently as possible.</p>