title: Solving linear system over integers with numpy
body: <p>I'm trying to solve an overdetermined linear system of equations with numpy. Currently, I'm doing something like this (as a simple example):</p>
  
  <pre><code>a = np.array([[1,0], [0,1], [-1,1]])
  b = np.array([1,1,0])
  
  print np.linalg.lstsq(a,b)[0]
  </code></pre>
  
  <pre>
  [ 1.  1.]
  </pre>
  
  <p>This works, but uses floats. Is there any way to solve the system over integers only? I've tried something along the lines of</p>
  
  <pre><code>print map(int, np.linalg.lstsq(a,b)[0])
  </code></pre>
  
  <pre>
  [0, 1]
  </pre>
  
  <p>in order to convert the solution to an array of ints, expecting <code>[1, 1]</code>, but clearly I'm missing something. Could anyone point me in the right direction?</p>