Numpy Note

x.shape = (1, 2) or (1, )

x.size = total number of elements

np.empty([1, 2])




import scipy as sp

sp.optimize.minimize(func, x0, arg=() ) where x0 is the initial guess that specifies the soln’s dimension, arg is the tuple that contains extra argument to func

returns scipy.optimize.OptimizeResult

scipy.optimize.OptimizeResult.x is the soln, possibly multiple elements because the dimension might be greater than 1



Leave a Reply

Your email address will not be published. Required fields are marked *