[转载] Numpy之logspace

参考链接: Python中的numpy.logspace

目录 

代码 

输出 

(很多都与linspace类似,可参考) 

代码 

#logspace返回值为ndarray对象,float型

#numpy.logspace(start, stop, num, endpoint, base, dtype)

#数据头一定是base^start,若endpoint=True,数据尾为base^end,其余数据为base^(start,end)

a=np.logspace(1,5,5,base=2)

print(a) 

输出 

[ 2.  4.  8. 16. 32.]

猜你喜欢

转载自blog.csdn.net/u013946150/article/details/113078014
今日推荐