title: How do I count the longest consecutive '0' flanked by number '1' in is string using pandas dataframe
body: <p>I want to do I count the longest consecutive  '0' flanked by number '1' in is string using pandas dataframe</p>
  
  <p>Here's my dataset</p>
  
  <pre><code>Id     label
  1          1
  2         11
  3        101
  4      10101
  5       1001
  </code></pre>
  
  <p>Here's my expected output</p>
  
  <pre><code>Id     label   result
  1          1        0
  2         11        0
  3        101        1
  4      10101        1
  5       1001        2
  </code></pre>