title: How to calculate number of duplicates in a list of numpy arrays?
body: <p>I have a list of arrays (permutations) that I need to clean up.
  This is how my current list looks like:</p>
  <pre><code>&gt;&gt;&gt;permutations
  [array([1, 2, 6, 7]),
   array([1, 2, 6, 7]),
   array([1, 2, 6, 7]),
   array([1, 2, 3, 8]),
   array([1, 2, 3, 8]),
   array([1, 2, 3, 8]),
   array([2, 3, 4, 9]),
   array([2, 3, 4, 9]),
   array([2, 3, 4, 9]),
   array([ 3,  4,  5, 10]),
   array([ 3,  4,  5, 10]),
   array([ 3,  4,  5, 10]),
   array([ 4,  5,  6, 11]),
   array([ 4,  5,  6, 11]),
   array([ 4,  5,  6, 11]),
   array([ 1,  5,  6, 12]),
   array([ 1,  5,  6, 12]),
   array([ 1,  5,  6, 12])]
  </code></pre>
  <p>What I want:</p>
  <pre><code>&gt;&gt;&gt;neat_perm
  [(array([1, 2, 6, 7]),3), 
  (array([1, 2, 3, 8]),3),
  (array([2, 3, 4, 9]),3)
  (array([3, 4, 5, 10]), 3),
  (array([4, 5, 6, 11]), 3),
  (array([1, 5, 6, 12]), 3)]
  </code></pre>
  <p>What I want to do, is to create a list of tuples, where the first element of the tuple is the array, and the second element of the tuple is the number of times it was repeated in <code>permutations</code>.</p>
  <p>The straightforward, brute force method is to do the <code>O(n^2)</code> np.array_equal over the array to ensure there are no repeats. The problem is the algorithmic complexity. <code>list(set(permutations))</code>, <code>permutations.count()</code> does not work as np arrays are not hashable.</p>
  <p>I would appreciate any advice you have for me, to get this more efficient, in terms of lines of code required, or time/memory complexity!</p>