Set of matrices
<p>I have lots of matrices (as result of rotations, etc.), but I would be sure to store them only once. I thought about <em>using a set</em> :</p>

<pre><code>print set([np.matrix([[0, 0],[0, 1],[1, 1],[2, 1]]), 
 np.matrix([[0, 0],[1, 0],[1, -1],[1, -2]])])
</code></pre>

<p>Unfortunately, I get :</p>

<blockquote>
  <p>TypeError: unhashable type: 'matrix'</p>
</blockquote>

<p>It's sad because a set would be exactly the right data type to avoid repetitions, and be able to use union, intersection, etc.</p>

<p><strong>How to work with sets of matrices in Python?</strong></p>