title: How do I print an aligned numpy array with (text) row and column labels?
body: <p>Is there any elegant way to exploit the correct spacing feature of <code>print numpy.array</code> to get a 2D array, with proper labels, that aligns properly? For example, given an array with 4 rows and 5 columns, how can I provide the array and appropriately sized lists corresponding to the row and header columns to generate some output that looks like this?</p>
  
  <pre><code>      A   B   C   D   E
  Z [[ 85  86  87  88  89]
  Y  [ 90 191 192  93  94]
  X  [ 95  96  97  98  99]
  W  [100 101 102 103 104]]
  </code></pre>
  
  <p>If I naively try: </p>
  
  <pre><code>import numpy
  x = numpy.array([[85, 86, 87, 88, 89], \
                   [90, 191, 192, 93, 94], \
                   [95, 96, 97, 98, 99], \
                   [100,101,102,103,104]])
  
  row_labels = ['Z', 'Y', 'X', 'W']
  
  
  print "     A   B   C   D   E"
  for row, row_index in enumerate(x):
      print row_labels[row_index], row
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>      A   B   C   D   E
  Z  [85  86  87  88  89]
  Y  [90 191 192  93  94]
  X  [95  96  97  98  99]
  W  [100 101 102 103 104]
  </code></pre>
  
  <p>Is there any way i can get things to line up intelligently? I am definitely open to using any other library if there is a better way to solve my problem.</p>