title: How to count the number of separate regions in python array
body: <p>I need to count the number of separate regions in an array.</p>
  
  <p>An example array is below. I can count the number of unique strings but if there are two distinct islands like in the grid below where 64733 is in the upper left and bottom right my function won't properly count the number of regions. 
  Can anyone help me to find a way to count the number of regions if two of the regions are comprised of the same numbers? Im writing in python 2.x.</p>
  
  <pre><code>|64733|20996|92360|92360|04478|04478|04478|04478|04478|98101
  |64733|92360|92360|92360|04478|04478|04478|04478|04478|04478
  |64733|92360|29136|92360|04478|04478|04478|04478|04478|04478
  |64733|92360|29136|92360|04478|04478|04478|04478|04478|04478
  |92360|92360|92360|92360|04478|04478|04478|04478|04478|04478
  |04478|04478|04478|04478|04478|04478|04478|04478|04478|04478
  |04478|04478|04478|04478|04478|04478|04478|04478|04478|04478
  |04478|04478|04478|04478|04478|04478|04478|04478|04478|04478
  |04478|04478|04478|04478|04478|04478|04478|04478|04478|64773
  |04478|04478|04478|04478|04478|04478|04478|04478|64773|64773
  </code></pre>
  
  <p>The input is a 3d array and looks like</p>
  
  <pre><code>[[['6', '4', '7', '3', '3'],
    ['2', '0', '9', '9', '6'],
    ['9', '2', '3', '6', '0'],
    ['9', '2', '3', '6', '0'],
    ['0', '4', '4', '7', '8'],
    ['0', '4', '4', '7', '8'],
    ['0', '4', '4', '7', '8'],
    ['0', '4', '4', '7', '8'],
    ['0', '4', '4', '7', '8'],
    ['9', '8', '1', '0', '1']],
   [['6', '4', '7', '3', '3'],
    ['9', '2', '3', '6', '0'],
    ['9', '2', '3', '6', '0'],
    ['9', '2', '3', '6', '0'],
    ['0', '4', '4', '7', '8'],
    ['0', '4', '4', '7', '8'],
    ['0', '4', '4', '7', '8'],
    ['0', '4', '4', '7', '8'],
    ['0', '4', '4', '7', '8'],
    ['0', '4', '4', '7', '8']],
   [['6', '4', '7', '3', '3'],
    ['9', '2', '3', '6', '0'],
  </code></pre>
  
  <p>This is not the complete input (because it was huge) but it gets the point across i think</p>
  
  <p>So would be where any unique symbol string of numbers lies and the total number of adjacent strings that are identical (adjacent being up down left right, not diagonal). </p>
  
  <pre><code>enter code here
  </code></pre>