深度学习中用到的numpy命令数组运算部分命令汇总
numpy数组中数字运算 命令汇总2.1 np.square()——对数组中每一个元素平方,返回一个新数组格式:np.square(a)import numpy as npa = np.arange(1, 7).reshape(2, 3)s = np.square(a) #对a中的每一个元素平方,形成新的数组返回给sprint("a=\n", a, "\nb=\n", s)结果:a=s=[[1 2 3] [4 5 6]][[ 1 4 9] [16 25 36]]
原创
2021-07-30 11:53:24 ·
1788 阅读 ·
0 评论