python - "AttributeError: 'list' object has no attribute 'ravel'" -


i have system of differential equations , need calculate jacobian. code below throws attributeerror: 'list' object has no attribute 'ravel'. missing?

import numpy np import numdifftools ndt  def rhs(z, t=0):     x,y = z      xdot = (x/5 + y)*(-x**2+1)     ydot = -x*(-y**2+1)      return [xdot, ydot]  jfun = ndt.jacobian(rhs)  jfun([1,1]) 

just do:

return np.array([xdot, ydot]) 

instead. should work...


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -