91
numpy.arrange()
It creates an array by using the evenly spaced values over the given interval. The interval mentioned is half opened i.e. [Start, Stop]).
Syntax
Parameters
It accepts the following parameters.
- start: The starting of an interval. The default is 0.
- stop: represents the value at which the interval ends excluding this value.
- step: The number by which the interval values change.
- dtype: the data type of the numpy array items.
Return
An array within the specified range is returned.
Example 1
Output:
[0. 2. 4. 6. 8.]
Example 2
Output:
The array over the given range is [10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95]
Next Topicnumpy.asarray()