title: Python scipy: unsupported operand type(s) for ** or pow(): 'list' and 'list'
body: <p>I need to fit function to array of data and get optimal coefficients of an equation of this function. I use <strong>curve_fit</strong> method from scipy library. It is based on least squares method.</p>
  
  <pre><code>import numpy as np 
  from scipy.optimize import curve_fit
  
  #This is my function from which i need to get optimal coefficients 'a' and 'b'
  def func(x, a, b):  
  return a*x**(b*x)
  
  #the arrays of input data                               
  x = [1,2,3,4,5]
  y =[6,7,8,9,10]
  
  #default (guess) coefficients
  p0 = [1, 1] 
  
  popt, pcov = curve_fit(func, x, y, p0)
  print popt
  </code></pre>
  
  <p>It returns the following error</p>
  
  <blockquote>
    <p>TypeError: unsupported operand type(s) for ** or pow(): 'list' and 'list'</p>
  </blockquote>
  
  <p>But when I use the other, more simple function with no power operation it works </p>
  
  <pre><code>def func(x, a, b):  
  return a*x + b
  </code></pre>
  
  <p>It must be trying to bulid number to a power of an entire array of input data</p>
  
  <p>What to do? Help please...</p>