title: How to print Numpy arrays without any extra notation (square brackets [ ] and spaces between elements)?
body: <p>I have a 2-dimensional numpy array that looks like this:</p>
  
  <pre><code>[[a b c]
   [d e f]
   [g h i]]
  </code></pre>
  
  <p>I'd like to print it without any of the default notational fluff that typically comes with arrays; namely the <code>[</code>, <code>]</code> and the spaces between the elements. Something like this:</p>
  
  <pre><code>abc
  def
  ghi
  </code></pre>
  
  <p>Is it possible to do such a thing (without a trivial and possibly expensive Python loop, of course)?</p>
  
  <p>I have looked at <a href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.set_printoptions.html" rel="noreferrer">numpy.set_printoptions</a> but it looks like it only sets presentational options for how elements are displayed, not the characters in between.</p>
  
  <p><strong>Edit</strong>: The elements in the array have a string representation that can be anything, including <code>[</code>, <code>]</code> and whitespace. Minimal example of how to build such an array:</p>
  
  <pre><code>class custom(object):
      def __repr__(self):
          return 'a'
  a = numpy.empty((5, 5), custom)
  a.fill(custom())
  print a
  </code></pre>