scipy.misc.derivative for multiple argument function

后端 未结 3 1746
清酒与你
清酒与你 2020-12-28 18:39

It is straightforward to compute the partial derivatives of a function at a point with respect to the first argument using the SciPy function scipy.misc.derivative

3条回答
  •  梦谈多话
    2020-12-28 19:46

    Yes, it is implemented in sympy. Demo:

    >>> from sympy import symbols, diff
    >>> x, y = symbols('x y', real=True)
    >>> diff( x**2 + y**3, y)
    3*y**2
    >>> diff( x**2 + y**3, y).subs({x:3, y:1})
    3
    

提交回复
热议问题