title: Transpose of a vector using numpy
body: <p>I am having an issue with Ipython - Numpy. I want to do the following operation:</p>
  
  <pre><code>x^T.x
  </code></pre>
  
  <p>with <img src="https://chart.googleapis.com/chart?cht=tx&amp;chl=x%5Cin%5Cmathbb%7BR%7D%5E%7Bn%7D" alt="formula"> and x^T the transpose operation on vector x. x is extracted from a txt file with the instruction:</p>
  
  <pre><code>x = np.loadtxt('myfile.txt')
  </code></pre>
  
  <p>The problem is that if i use the transpose function</p>
  
  <pre><code>np.transpose(x)
  </code></pre>
  
  <p>and uses the shape function to know the size of x, I get the same dimensions for x and x^T. Numpy gives the size with a L uppercase indice after each dimensions. e.g.</p>
  
  <pre><code>print x.shape
  print np.transpose(x).shape
  
  (3L, 5L)
  (3L, 5L)
  </code></pre>
  
  <p>Does anybody know how to solve this, and compute x^T.x as a matrix product?</p>
  
  <p>Thank you!</p>