pip install numpy scipy matplotlib ipython jupyter pandas sympy nose
验证安装结果
在命令行执行
1
ipython --pylab
如果安装正确,系统应该显示:
1 2 3 4
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)] Type 'copyright', 'credits' or 'license'for more information IPython 7.5.0 -- An enhanced Interactive Python. Type '?'forhelp. Using matplotlib backend: TkAgg
看到以上的提示符以后(具体Python版本号可能会有差别,但不影响开发),顺序执行以下命令:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
In [1]: from scipy import special, optimize
In [2]: f = lambda x: -special.jv(3,x)
In [3]: sol = optimize.minimize(f, 1.0)
In [4]: x = linspace(0, 10, 5000)
In [5]: x Out[5]: array([0.00000000e+00, 2.00040008e-03, 4.00080016e-03, ..., 9.99599920e+00, 9.99799960e+00, 1.00000000e+01])
In [6]: plot(x, special.jv(3, x), '-', sol.x, -sol.fun, 'o') Out[6]: [<matplotlib.lines.Line2D at 0x26678c25240>, <matplotlib.lines.Line2D at 0x26678c25390>]