如何在python中的numpy下从linspace函数中排除起点?

Mos*_*din 6 numpy python-3.x linspace

我想使用 numpy 从 python 数组中排除起点。我怎样才能执行?例如我想排除 0,但想从下一个实数继续(即想从大于 0 开始运行)以下代码x=np.linspace(0,2,10)

Ber*_*ter 6

x=np.linspace(0,2,10)[1:] #remove the first element by indexing
print(x)
[0.22222222 0.44444444 0.66666667 0.88888889 1.11111111 1.33333333
 1.55555556 1.77777778 2.        ]
Run Code Online (Sandbox Code Playgroud)