title: TypeError: unsupported operand type(s) for ** or pow(): 'list' and 'int' and Invalid arguments error
body: <p>I'm currently writing a python script which reads in data from a .xlsx file. I then fit the data with the curve_fit methode provided by scipy. For my fitfunction I first used the following: </p>
  
  <pre><code>def fitfunc_polynome_OP_BL(x ,a, b, c, d, e, g, h, i):
      return a*(x**7) + b*(x**6) + c*(x**5) + d*(x**4) + e*(x**3) + g*(x**2) + h*x +i
  </code></pre>
  
  <p>but then I get the above mentioned error. I found a solution for this error: np.power(), but when I do this I get an onther error which didn't occur earlier.. So when I replace the "**" with "np.power()" to get:</p>
  
  <pre><code>def fitfunc_polynome_OP_BL(x ,a, b, c, d, e, g, h, i):
      return a*(np.power(x,7)) + b*(np.power(x,6))+ c*np.power((x,5)) + d*(np.power(x,4)) + e*(np.power(x,3)) + g*(np.power(x,2)) + h*x +i
  </code></pre>
  
  <p>I get an invalid arguments error(*), while I keep the same number of parameters... is there someone who could help?</p>
  
  <p>(*)</p>
  
  <pre><code> Traceback (most recent call last):
    File "snr_fitting_excel.py", line 81, in &lt;module&gt;
      snr_fitting_excel(18,11,8)
    File "snr_fitting_excel.py", line 45, in snr_fitting_excel
      popt, pcov = curve_fit(fitfunc_polynome_OP_BL, wavelengths, height[i])
    File "C:\ProgramData\Anaconda2\lib\site-packages\scipy\optimize\minpack.py", l
  ine 736, in curve_fit
      res = leastsq(func, p0, Dfun=jac, full_output=1, **kwargs)
    File "C:\ProgramData\Anaconda2\lib\site-packages\scipy\optimize\minpack.py", l
  ine 377, in leastsq
      shape, dtype = _check_func('leastsq', 'func', func, x0, args, n)
    File "C:\ProgramData\Anaconda2\lib\site-packages\scipy\optimize\minpack.py", l
  ine 26, in _check_func
      res = atleast_1d(thefunc(*((x0[:numinputs],) + args)))
    File "C:\ProgramData\Anaconda2\lib\site-packages\scipy\optimize\minpack.py", l
  ine 454, in func_wrapped
      return func(xdata, *params) - ydata
    File "snr_fitting_excel.py", line 70, in fitfunc_polynome_OP_BL
      return a*(np.power(x,7)) + b*(np.power(x,6))+ c*np.power((x,5)) + d*(np.powe
  r(x,4)) + e*(np.power(x,3)) + g*(np.power(x,2)) + h*x +i
  </code></pre>
  
  <p>ValueError: invalid number of arguments</p>
  
  <p>PS this is the code: </p>
  
  <pre><code> #version in which all data will be read from the excelfile. The resulting fitparameters will be written into the excisting excelfile.
  
  def snr_fitting_excel(number_of_altitude_points, row_begin_position_of_data, number_of_wavelengths):
     n_alt = number_of_altitude_points
     n_lambda = number_of_wavelengths
     begin = row_begin_position_of_data
     end = begin + n_alt
     xlsx = pd.ExcelFile('Test.xlsx')
     df = pd.read_excel(xlsx, 'SNR-COPY')  
     d = (n_alt, n_lambda)
     height = np.zeros(d, dtype=int)
     for j in range(begin, end):
        for i in range(2,10):
           height[j-begin][i-2] = (np.around(df.iat[j,i], decimals =0))
     height = np.array(height)   
  #array with the different wavelengths at which the data was taken   
     wavelengths = [400, 450, 500, 550, 600, 650, 700, 800]
  #fit the points with the desired function from above
     for i in range(0, len(height)):
          popt, pcov = curve_fit(fitfunc_polynome_OP_BL, wavelengths, height[i])
  
  
          fig = plt.figure()
          plt.plot(wavelengths, height[i], 'o')
          plt.plot(wavelengths, fitfunc_polynome_OP_BL(wavelengths, *popt), 'r-', label ='fit: a=%5.3f, b=%5.3f, c=%5.3f, d=%5.3f, e=%5.3f, g=%5.3f, h=%5.3f, i=%5.3f' % tuple(popt))
          fig.savefig("snr_op_fit_bl" + str((i+1)*5) +".pdf")
          print(popt) 
  
  def fitfunc_polynome_OP_BL(x ,a, b, c, d, e, g, h, i):
  #   return a*(x**7) + b*(x**6) + c*(x**5) + d*(x**4) + e*(x**3) + g*(x**2) + h*x +i
      return a*(np.power(x,7)) + b*(np.power(x,6))+ c*np.power((x,5)) + d*(np.power(x,4)) + e*(np.power(x,3)) + g*(np.power(x,2)) + h*x +i
  
  if __name__ == '__main__':
  
      print("\nFitting SNR_UV---------------------------------------------\n")
      snr_fitting_excel(18,11,8)
  </code></pre>