11-25numpy学习笔记

numpy从范围内创建数组

1 np.arange([start,]stop[,step],dtype)

2 np.linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None)
参数	描述
start	序列的起始值
stop	序列的终止值,如果endpoint为true,该值包含于数列中
num	要生成的等步长的样本数量,默认为50
endpoint	该值为 true 时,数列中包含stop值,反之不包含,默认是True。
retstep	如果为 True 时,生成的数组中会显示间距,反之不显示。
dtype	ndarray 的数据类型

np.logspace(start, stop, num=50, endpoint=True, base=10.0, dtype=None)

参数	描述
start	序列的起始值为:base ** start
stop	序列的终止值为:base ** stop。如果endpoint为true,该值包含于数列中
num		要生成的等步长的样本数量,默认为50
endpoint	该值为 true 时,数列中中包含stop值,反之不包含,默认是True。
base	对数 log 的底数。
dtype	ndarray 的数据类型

你可能感兴趣的:(个人笔记,numpy)