title: Left Matrix Division and Numpy Solve
body: <p>I am trying to convert code that contains the \ operator from Matlab (Octave) to Python. Sample code</p>
  <pre class="lang-matlab prettyprint-override"><code>B = [2;4]
  b = [4;4]
  B \ b
  </code></pre>
  <p>This works and produces 1.2 as an answer. Using this web page</p>
  <p><a href="http://mathesaurus.sourceforge.net/matlab-numpy.html" rel="nofollow noreferrer">http://mathesaurus.sourceforge.net/matlab-numpy.html</a></p>
  <p>I translated that as:</p>
  <pre class="lang-py prettyprint-override"><code>import numpy as np
  import numpy.linalg as lin
  B = np.array([[2],[4]])
  b = np.array([[4],[4]])
  print lin.solve(B,b)
  </code></pre>
  <p>This gave me an error:</p>
  <pre><code>numpy.linalg.linalg.LinAlgError: Array must be square
  </code></pre>
  <p>How come Matlab \ works with non square matrix for B?</p>
  <p>Any solutions for this?</p>