title: Finding duplicates in python list containing arrays
body: <p>I have a python list called <code>added</code> that contains 156 individual lists containing two cols references and an array. An example is as follows:</p>
  
  <pre><code>[0, 1, array]
  </code></pre>
  
  <p>The problem is I have duplicates, although they are not exact as the column references will be flipped. The following two will be exactly the same:</p>
  
  <pre><code>[[0, 1, array], [1, 0, array]]
  </code></pre>
  
  <p>The way I have tried removing duplicates was to sort the numbers and check if any were the same and if so then append the result to a new list.</p>
  
  <p>Both resulted in separate errors:</p>
  
  <pre><code>for a in range(len(added)):
      added[a][0:2] = added[a][0:2].sort()
  
  TypeError: can only assign an iterable
  </code></pre>
  
  <p>I also tried to see if the array was in my empty python list <code>no_dups</code> and if it wasnt then append the column refernces and array.:</p>
  
  <pre><code>no_dups = []
  for a in range(len(added)):
      if added[a][2] in no_dups:
          print('already appended')
      else:
          no_dups.append(added[a])
  
  &lt;input&gt;:2: DeprecationWarning: elementwise comparison failed; this will raise an error in the future.
  </code></pre>
  
  <p>Neither worked. I'm struggling to get my head round how to remove duplicates here.</p>
  
  <p>Thanks.</p>
  
  <p>EDIT: reproducible code:</p>
  
  <pre><code>import numpy as np
  import pandas as pd
  from sklearn import datasets
  data = datasets.load_boston()
  
  df = pd.DataFrame(data.data, columns=data.feature_names)
  X = df.to_numpy()
  
  
  cols = []
  added = []
  for column in X.T:
      cols.append(column)
  for i in range(len(cols)):
      for x in range(len(cols)):
          same_check = cols[i] == cols[x]
          if same_check.all() == True:
              continue
          else:
              added.append([i, x, cols[i] * cols[x]])
  </code></pre>
  
  <p>This code should give you access to the entire created <code>added</code> list.</p>