title: Casting python list to numpy array gives the wrong shape
body: <p>I am reading data from a file, like so:</p>
  <pre><code>f = open('some/file/path')
  data = f.read().split('\n')
  </code></pre>
  <p>Which gives me something like <code>data = ['1 a #', '3 e &amp;']</code>
  if the original file was</p>
  <blockquote>
  <p>1 a #</p>
  <p>3 e &amp;</p>
  </blockquote>
  <p>I need it in a form like</p>
  <p><code>[['1','a','#'],['3','e','&amp;']]</code></p>
  <p>so that I can then do a <code>np.swapaxes()</code> on it and turn it into</p>
  <p><code>[['1','3'],['a','e'],['#','&amp;']]</code></p>
  <p>But whenever I do do that, the <code>swapaxes</code> call fails, and it is because I am not ending up with a numpy array of the right shape. To turn the strings into lists of strings, I do:</p>
  <pre><code>for n in range(len(data)): data[n] = data[n].split()
  data = np.array(data)
  </code></pre>
  <p>But when i check the shape:</p>
  <pre><code>np.shape(data)
  &gt;&gt;&gt;(2,)
  </code></pre>
  <p>So I cannot swap axes. I've tried doing the <code>numpy</code> array in a few different ways but everything seems to create a <code>numpy</code> array that doesn't know there is another dimension inside of the arrays within the array.</p>