title: How should I evaluate equivalency of floating point numpy matrices?
body: <p>While working on a matrix equivalency problem, which involves a variety of inverse transformations, I found some unexpected behaviour I wanted to clarify. I've made all the matrices equivalent here, as the actual transformations aren't really relevant to the issue I'm having.</p>
  
  <pre><code>a = np.matrix([ 1, 1], [-1, 4]])
  
  x = inv(a)
  y = inv(a)
  z = inv(a)
  
  (x == y &amp; z).all()
  
  Note: x = matrix([ 0.8, -0.2],
                   [ 0.2,  0.2]]) 
  </code></pre>
  
  <p>Which returns the following error message:</p>
  
  <pre><code>TypeError: ufunc 'bitwise_and' not supported for the input types, and the 
  inputs could not be safely coerced to any supported types according to the 
  casting rule ''safe''
  </code></pre>
  
  <p>Is this error is being raised because <code>&amp;</code> operators can't be used with floating points? The following methods seem to return correct answers, but I would appreciate input on a preferred method for the given problem. </p>
  
  <pre><code>(np.equal(x, y) &amp; np.equal(y, z)).all()
  True
  
  np.equal([x,y,z], [y,z,x]).all()
  True
  </code></pre>