numpy.linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None)
start:开始数值
stop:结束数值
num:默认是50个样本点(数据),为正整数。
endpoint:默认为True,如果改为Fasle取不到右端点。
restep:步长,如第一个数据和第第二个数据之间的距离。
dtype:可以设置数值类型
例子:
1.基本操作:start=1,stop=20,num=20
2.基本操作(retstop=True)
3.基本操作(endpoint =False)
3.基本操作(dtype=int)返回一个元组,每个数值转换为int型