V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
bin222
V2EX  ›  Python

pyhton 怎么求某点的导数值

  •  
  •   bin222 · 2018-08-13 10:36:54 +08:00 · 2575 次点击
    这是一个创建于 2075 天前的主题,其中的信息可能已经有所发展或是发生改变。
    from sympy import *
    x=Symbol('x')
    y=x**2
    dx=diff(y,x)
    上面这段程序求出了 y 关于 x 的导数:dx=2*x
    如何求 x=2 时,导数的值 dx=2*2=4 呢?
    这个要怎么代入呢?我的意思如何通过程序做。
    metaquant
        1
    metaquant  
       2018-08-13 11:02:12 +08:00
    from sympy import *
    dx=2*x
    u = lambdify(x,dx)
    print(u(2))
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1474 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 17:15 · PVG 01:15 · LAX 10:15 · JFK 13:15
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.