title: How can I compare two lists of numpy vectors?
body: <p>I have two <code>list</code>s of <code>numpy</code> vectors and wish to determine whether they represent approximately the same points (but possibly in a different order).</p>
  
  <p>I've found methods such as <code>numpy.testing.assert_allclose</code> but it doesn't allow for possibly different orders. I have also found <code>unittest.TestCase.assertCountEqual</code> but that doesn't work with <code>numpy</code> arrays!</p>
  
  <p>What is my best approach?</p>
  
  <pre><code>import unittest
  
  import numpy as np
  
  first = [np.array([20, 40]), np.array([20, 60])]
  second = [np.array([19.8, 59.7]), np.array([20.1, 40.5])]
  
  np.testing.assert_all_close(first, second, atol=2)  # Fails because the orders are different
  unittest.TestCase.assertCountEqual(None, first, second)  # Fails because numpy comparisons evaluate element-wise; and because it doesn't allow a tolerance
  </code></pre>