title: Efficient ndarray operations
body: <p>I'm converting some Matlab code in Python. I need to do some matrix manipulation. My matrix (A) is (right now) a 65x3 matrix. However, the number of rows is variable depending on what step I'm at in the program.</p>
  
  <p>In Matlab, the code I'm working on is:</p>
  
  <pre><code>output = inv(A'*A) * A';
  </code></pre>
  
  <p>The following Python code reproduces the expected output just fine. I'm just curious if there is a better (more Pythonic, faster, etc) way to do this? I'm trying to stick only to basic Python and numpy.</p>
  
  <pre><code>output = np.dot(np.linalg.inv(np.dot(np.transpose(A), A)), np.transpose(A))
  </code></pre>
  
  <p>Thanks to anyone who is willing to help.</p>