arange function
(Shortest import: from brian2 import arange)
- brian2.units.unitsafefunctions.arange([start, ]stop, [step, ]dtype=None, *, like=None)[source]
Return evenly spaced values within a given interval.
arange
can be called with a varying number of positional arguments:arange(stop)
: Values are generated within the half-open interval[0, stop)
(in other words, the interval includingstart
but excludingstop()
).arange(start, stop)
: Values are generated within the half-open interval[start, stop)
.arange(start, stop, step)
Values are generated within the half-open interval[start, stop)
, with spacing between values given bystep
.
For integer arguments the function is roughly equivalent to the Python built-in
range
, but returns an ndarray rather than arange
instance.When using a non-integer step, such as 0.1, it is often better to use
numpy.linspace
.See the Warning sections below for more information.