标签:技术分享 src class ima images 开始 aar return http
aArray = array([(1,2,3), (4,5,6)])
sin(aArray)
bArray = aArray.reshape(3, 2)
# 行求和 ()
aArray.sum(axis = 0)
# array([ 5, 7, 9 ])
# 列求和
aArray.sum(axis = 1)
# array([ 6, 15 ])
cArray = array([1, 3, 5])
cArray[:1]
dArray = array([2, 4, 6])
eArray = array([7, 8, 9])
where(cArray > 2, dArray, eArray)
# array([7, 4, 6]); cArray第一个值不大于2, 取eArray:7
# cArray第二值大于二,取dArray:4; cArray第三个值大于2, 取dArray:6
def fun(x, y):
return (x+1) * (y+1)
# (9, 9)是序列大小,从0开始
arr = fromfunction(fun, (9,9))
标签:技术分享 src class ima images 开始 aar return http
原文地址:http://www.cnblogs.com/douzujun/p/7352071.html