Suppose I want to generate an array between 0 and 1 with spacing 0.1. In R, we can do
> seq(0, 1, 0.1)
[1] 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
In Python, since numpy.arange doesn't include the right end, I need to add a small amount to the stop.
np.arange(0, 1.01, 0.1)
array([0. , 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1. ])
But that seems a little weird. Is it possible to force numpy.arange to include the right end? Or maybe some other functions can do it?