np.linspace(a,b,c)用于创建一个等差序列的向量,向量值是[a,b]之间均匀分布的c个实数
import numpy as np
arithmetic_sequence = np.linspace(0,10,9).reshape(-1,1)
print(arithmetic_sequence)
输出结果如下:
[[ 0. ]
[ 1.25]
[ 2.5 ]
[ 3.75]
[ 5. ]
[ 6.25]
[ 7.5 ]
[ 8.75]
[10. ]]
Process finished with exit code 0