SciPy Python数学、科学和工程模块

SciPy简介

SciPy,Python第三方库,可用于数学、科学和工程模块的模块,是很多机器学习和深度学习框架采用这个库构建模型的算法。SciPy库包括统计、优化、积分、线性代数、傅立叶变换、信号和图像处理、ODE求解器等模块。

SciPy应用实例

from scipy import special
import numpy as np
def drumhead_height(n, k, distance, angle, t):
   kth_zero = special.jn_zeros(n, k)[-1]
   return np.cos(t) * np.cos(n*angle) * special.jn(n, distance*kth_zero)
theta = np.r_[0:2*np.pi:50j]
radius = np.r_[0:1:50j]
x = np.array([r * np.cos(theta) for r in radius])
y = np.array([r * np.sin(theta) for r in radius])
z = np.array([drumhead_height(1, 1, r, theta, 0.5) for r in radius])
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_axes(rect=(0, 0.05, 0.95, 0.95), projection='3d')
ax.plot_surface(x, y, z, rstride=1, cstride=1, cmap='RdBu_r', vmin=-0.5, vmax=0.5)
ax.set_xlabel('X')
ax.set_ylabel('Y')
ax.set_xticks(np.arange(-1, 1.1, 0.5))
ax.set_yticks(np.arange(-1, 1.1, 0.5))
ax.set_zlabel('Z')
plt.show()

SciPy Github统计数据

BSD-3-Clause license

Github 12k stars

SciPy安装命令

pip install scipy或 conda install scipy

Python版本要求

scipy 1.11.4 Requires: Python >=3.9(数据来源:pypi)

免责声明:内容编辑自网络,仅供参考,不保证正确性,不作任何决策依据!!以上数据皆截止于博文的写稿日期。


行业导航 / Python指南 :
























Copyright © 2022-2024 笨鸟工具 x1y1z1.com All Rights Reserved.