在python中,怎么查看numpy模块中的exp函数源代码

用的是spyder 系统
2025-04-04 19:27:46
推荐回答(1个)
回答1:

pip install ipython
ipython

一般来说这样就能看到源代码了,不过numpy好像比较特殊,可以参考如下方法:

  1. 安装pipenv,https://docs.pipenv.org/


  2. 用pipenv打开numpy源码

$ pipenv --three
$ python3.6 -c "from pathlib import Path;fn='Pipfile';Path(fn).write_text(Path(fn).read_text().replace('pypi.org', 'mirrors.aliyun.com/pypi'))"
$ pipenv shell
$ pipenv install numpy
$ pipenv open numpy