title: Python: TypeError: only length-1 arrays can be converted to Python scalars
body: <p>I have a func </p>
  
  <pre><code>f(x) = sin(x/5.0)*exp(x/10.0) + 5*exp(-x/2.0)
  </code></pre>
  
  <p>I need to solve system of linear equations</p>
  
  <pre><code>w0 + w1x1 + w2(x1)**2 + ... + wn(x1)**n = f(x1)
  </code></pre>
  
  <p>I solve that but I have a problem with plot it</p>
  
  <pre><code>from math import sin, exp
  from scipy import linalg
  import numpy as np
  
  b = []
  def f(x):
      return sin(x/5.0)*exp(x/10.0) + 5*exp(-x/2.0)
  
  for i in [1, 15]:
      b.append(f(i))
  
  A = []
  
  for i in [1, 15]:
      ij = []
      x0 = i ** 0
      x1 = i ** 1
      ij.append(x0)
      ij.append(x1)
      A.append(ij)
  
  matrix = np.array(A)
  b = np.array(b).T
  
  x = linalg.solve(matrix, b)
  from matplotlib import pyplot as plt
  plt.plot(x, f(x))
  </code></pre>
  
  <p>But it returns</p>
  
  <pre><code>TypeError: only length-1 arrays can be converted to Python scalars
  </code></pre>
  
  <p>How can I solve this problem?</p>