title: Creating DataFrame of groups by pixel values in Python (number, size, etc.)
body: <p>I have the following data (simple representation of black particles on a white filter):</p>
  <pre><code>data = [
      [0, 0, 0, 255, 255, 255, 0, 0],
      [0, 255, 0, 255, 255, 255, 0, 0],
      [0, 0, 0, 255, 255, 255, 0, 0, ],
      [0, 0, 0, 0, 255, 0, 0, 0],
      [0, 255, 255, 0, 0, 255, 0, 0],
      [0, 255, 0, 0, 0, 255, 0, 0],
      [0, 0, 0, 0, 0, 255, 0, 0],
      [0, 0, 0, 0, 0, 255, 0, 0]
  ]
  </code></pre>
  <p>And I have counted the number of particles (groups) and assigned them each a number using the following code:</p>
  <pre><code>arr = np.array(data)
  groups, group_count = measure.label(arr &gt; 0, return_num = True, connectivity = 1)
  print('Groups: \n', groups)
  </code></pre>
  <p>With the <strong>Output</strong>:</p>
  <pre><code>Groups: 
   [[0 0 0 1 1 1 0 0]
   [0 2 0 1 1 1 0 0]
   [0 0 0 1 1 1 0 0]
   [0 0 0 0 1 0 0 0]
   [0 3 3 0 0 4 0 0]
   [0 3 0 0 0 4 0 0]
   [0 0 0 0 0 4 0 0]
   [0 0 0 0 0 4 0 0]]
  </code></pre>
  <p>I then have four (4) particles (groups) of different sizes.</p>
  <p>I am looking to create a DataFrame representing each particle. Like this:</p>
  <p><a href="https://i.stack.imgur.com/nNuhC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nNuhC.png" alt="DataFrame of particles (groups)" /></a></p>
  <p>Any help is much appreciated!</p>