title: Generating random unique 3D binary matrices
body: <p>I created a list containing a thousand random 10*10*10 binary matrices.</p>
  
  <pre><code>P=[]
  for idx in range (0,1000):
      s=(10,10,10)
      a=np.zeros(s)
      for i in range (0,10):
          for j in range (0,10):
              for k in range (0,10):
                  c=np.random.random(1)
                  if c&gt;0.5:
                      c=1
                  else:
                      c=0
                  a[i][j][k]=c
      P.append(a)
  </code></pre>
  
  <p>After that, I tried the following to make sure none of the matricies are repeated. However, I get an error for that.</p>
  
  <pre><code>unique_set=[]
  for idx in P:
      if idx not in unique_set:
          unique_set.append(idx)
  unique_set
  </code></pre>
  
  <p>This is the error I get:</p>
  
  <p><strong>ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()</strong></p>
  
  <p>What should I try instead?</p>