arange(start, stop, step, dtype)
Parameter | Description |
---|---|
start | [Optional] provide the start of the interval range. |
stop | provide end of the interval range. |
step | [Optional] the spacing between two adjacent values. |
dtype | [Optional] dtype is the type of output array. |
Example 1:
import numpy np
np.arange(1, 11)
//Reults:
array([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
Example 2:
import numpy np
np.arange(1, 14, 4)
//Output
array([ 1, 5, 9, 13])
Example 3: NumPy.arange() method Example
>>> import numpy as np
>>> np.arange(5)
array([0, 1, 2, 3, 4])
>>> np.arange(5.0)
array([ 0., 1., 2., 3., 4.])
I hope you get an idea about numpy aranges include endpoint.