title: Printing Lists as Tabular Data
body: <p>I am quite new to Python and I am now struggling with formatting my data nicely for printed output.</p>
  
  <p>I have one list that is used for two headings, and a matrix that should be the contents of the table. Like so:</p>
  
  <pre><code>teams_list = ["Man Utd", "Man City", "T Hotspur"]
  data = np.array([[1, 2, 1],
                   [0, 1, 0],
                   [2, 4, 2]])
  </code></pre>
  
  <p>Note that the heading names are not necessarily the same lengths. The data entries are all integers, though.</p>
  
  <p>Now, I want to represent this in a table format, something like this:</p>
  
  <pre class="lang-none prettyprint-override"><code>            Man Utd   Man City   T Hotspur
    Man Utd         1          0           0
   Man City         1          1           0
  T Hotspur         0          1           2
  </code></pre>
  
  <p>I have a hunch that there must be a data structure for this, but I cannot find it. I have tried using a dictionary and formatting the printing, I have tried for-loops with indentation and I have tried printing as strings.</p>
  
  <p>I am sure there must be a very simple way to do this, but I am probably missing it due to lack of experience.</p>