栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

Numpy(自用)

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Numpy(自用)

In[21]: from scipy import special In[22]: # Gamma函数 广义阶乘 generalized factorials 和相关函数 x [1, 5, 10] print( gamma(x) , special.gamma(x)) print( ln|gamma(x)| , special.gammaln(x)) print( beta(x, 2) , special.beta(x, 2)) gamma(x) [ 1.00000000e 00 2.40000000e 01 3.62880000e 05] ln|gamma(x)| [ 0. 3.17805383 12.80182748] beta(x, 2) [ 0.5 0.03333333 0.00909091] In[23]: # 误差函数 高斯积分 # 它的实现和它的逆实现 x np.array([0, 0.3, 0.7, 1.0]) print( erf(x) , special.erf(x)) print( erfc(x) , special.erfc(x)) print( erfinv(x) , special.erfinv(x)) erf(x) [ 0. 0.32862676 0.67780119 0.84270079] erfc(x) [ 1. 0.67137324 0.32219881 0.15729921] erfinv(x) [ 0. 0.27246271 0.73286908 inf]

12 高级的通用函数特性

In[25]: y np.zeros(10)
np.power(2, x, out y[::2])
print(y)
[ 1. 0. 2. 0. 4. 0. 8. 0. 16. 0.]
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/268227.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号