title: Jacobi Method & Basic Matrix Math using NUMPY
body: <p>I'm getting an import error for "norm". What am I not doing correct??</p>
  
  <p>I'm open to constructive feedback on improving the code, however I have to keep the parameters as they are!</p>
  
  <p>Thanks!!!</p>
  
  <p>Code is below:</p>
  
  <pre><code>import numpy as np
  from numpy import norm, inalg, array, zeros, diag, diagflat, dot, linalg
  
  """Test Case Data"""
  
   A = np.matrix([[4,-1,-1],[-2,6,1],[-1,1,7]])
   b = np.matrix([[3],[9],[-6]])
   x = np.matrix([[0],[0],[0]])
  
  
  """Main Function"""
  def jacobi(A, b, x, Tolerance, Iterations):
  
      V = np.diag(A)
      D = np.diag(V)
      R = D-A
      D_I = D.I
      D = np.asmatrix(D)
  
      Counter_1 = 1
      tol_gauge = 100
  
      while Counter_1 &lt;= Iterations:
      # I considered using the "dot" function in NUMPY but I was wary of mixed results
  
  
           iterative_approach_form = D_I * ((R*x)+b)
           tol_gauge = np.linalg.norm(iterative_approach_form-x)
           x = iterative_approach_form
  
      if initial_tol &lt;= Tolerance:
          return("The Solution x = {},y={}, z={} ".format(x[0], x[1], x[2]))
          return("The Solution was found in %s interation(s)" %(Counter_1))
  
      else: 
          pass
      Counter_1 +=1
  return("The Solution was not found in {} iteration(s)".format(Iterations))
  </code></pre>