#.arange( ) Function in

Опубликовано: 30 Май 2026
на канале: Coder Decoder
640
20

The arange() function is used to get evenly spaced values within a given interval.
Values are generated within the half-open interval [start, stop]. For integer arguments the function is equivalent to the Python built-in range function, but returns an ndarray rather than a list.
When using a non-integer step, such as 0.1, the results will often not be consistent. It is better to use linspace for these cases.import numpy as np

np.arange(5)
array([0, 1, 2, 3, 4])
np.arange(5.0)
array([ 0., 1., 2., 3., 4.])
np.arange(5,9)
array([5, 6, 7, 8])
np.arange(5,9,3)
array([5, 8])