title: How to square or raise to a power (elementwise) a 2D numpy array?
body: <p>I need to square a 2D numpy array (elementwise) and I have tried the following code:</p>
  
  <pre><code>import numpy as np
  a = np.arange(4).reshape(2, 2)
  print a^2, '\n'
  print a*a
  </code></pre>
  
  <p>that yields:</p>
  
  <pre><code>[[2 3]
  [0 1]]
  
  [[0 1]
  [4 9]]
  </code></pre>
  
  <p>Clearly, the notation <code>a*a</code> gives me the result I want and not <code>a^2</code>. </p>
  
  <p>I would like to know if another notation exists to raise a numpy array to the power of 2 or N? Instead of <code>a*a*a*..*a</code>.</p>