标签:相互 code 其他 生成 3.0 pytho art follow tst
def linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None):
endpoint
是一个bool类型的值,如果为"Ture","stop"是最后一个值,如果为"False",生成的数组不会包含"stop"值retstep
是一个bool类型的值,如果为"Ture",会返回样本之间的间隙。其他相似的函数
arange
和 linespace
相似,但是使用步长而不是样本的数量来确定生成样本的数量。>>> np.linspace(2.0, 3.0, num=5)
array([ 2. , 2.25, 2.5 , 2.75, 3. ])
>>> np.linspace(2.0, 3.0, num=5, endpoint=False)
array([ 2. , 2.2, 2.4, 2.6, 2.8])
>>> np.linspace(2.0, 3.0, num=5, retstep=True)
(array([ 2. , 2.25, 2.5 , 2.75, 3. ]), 0.25)
标签:相互 code 其他 生成 3.0 pytho art follow tst
原文地址:https://www.cnblogs.com/cloud-ken/p/9945748.html