import numpy as np
import scipy.optimize as spo
def function(x,y):
return (np.sin(x*y+y)*np.exp(-1*(x**2+y**2)))**-1
xi=[0,0]
answer=spo.fmin(function,xi)
print 'the answer is', answer
ฉันกำลังพยายามย่อฟังก์ชั่นนี้ให้เล็กสุด อย่างไรก็ตามการทำงานจะเกิดขึ้น
TypeError: function() takes exactly 2 arguments (1 given)