title: Checking if a matrix is symmetric in Numpy
body: <p>I'm trying to make a function with the arguments <code>(a,tol=1e-8)</code> that returns a boolean value that tells the user whether or not the matrix is symmetric (symmetric matrix is equal to its transpose). So far I have:</p>
  
  <pre><code>def check_symmetric(a, tol=1e-8):
  if np.transpose(a, axes=axes) == np.transpose(a, axes=axes):
      return True
  def sqr(s):
      rows = len(s)
      for row in sq:
          if len(row) != rows:
              return False
      return True
  if a != sqr(s):
      raise ValueError
  </code></pre>
  
  <p>although I keep getting an <code>axes isn't defined</code> message so I'm pretty sure that doesn't work at all...... the tests I'd like to pass are:</p>
  
  <pre><code>e = np.eye(4)
  f = np.diag([1], k=3)
  g = e[1:, :]
  
  print(check_symmetric(e))
  print(not check_symmetric(e + f))
  print(check_symmetric(e + f * 1e-9))
  print(not check_symmetric(e + f * 1e-9, 1e-10))
  try:
      check_symmetric(g)
      print(False)
  except ValueError:
      print(True)
  </code></pre>
  
  <p>Any help is appreciated, thanks!</p>