title: How to simplify array into only unique values in Python
body: <p>Because of array depth issues in PHP, receiving this array from Python becomes truncated with an ellipsis ("..."). I'd like to process the array in Python before returning back to php.</p>
  
  <p>Clarification: I need to maintain the inner sets [135, 121, 81]. These are R, G, B values and I'm tying to group sets that occur more than once. Values in sets need to maintain [1, 2, 3] sequence, NOT [1,2,3,4,5,6,7,8] as some answers have suggested below.</p>
  
  <p><strong>How would you simplify this 3D <code>numpy.ndarray</code> to a collection of unique RGB triples?</strong></p>
  
  <p>Here is how the array is printed by Python:</p>
  
  <pre><code>[[[135 121  81]
    [135 121  81]
    [135 121  81]
    ..., 
    [135 121  81]
    [135 121  81]
    [135 121  81]]
  
   [[135 121  81]
    [135 121  81]
    [135 121  81]
    ..., 
    [135 121  81]
    [135 121  81]
    [135 121  81]]
  
   [[ 67  68  29]
    [135 121  81]
    [ 67  68  29]
    ..., 
    [135 121  81]
    [135 121  81]
    [135 121  81]]
  
   ..., 
   [[200 170  19]
    [200 170  19]
    [200 170  19]
    ..., 
    [ 67  68  29]
    [ 67  68  29]
    [ 67  68  29]]
  
   [[200 170  19]
    [200 170  19]
    [200 170  19]
    ..., 
    [116 146  15]
    [116 146  15]
    [116 146  15]]
  
   [[200 170  19]
    [200 170  19]
    [200 170  19]
    ..., 
    [116 146  15]
    [116 146  15]
    [116 146  15]]]
  </code></pre>
  
  <p>Here is the code that I have attempted:</p>
  
  <pre><code>def uniquify(arr)
      keys = []
  
      for c in arr:
          if not c in keys:
              keys[c] = 1
          else:
              keys[c] += 1
  
      return keys
  
  result = uniquify(items)
  </code></pre>