numpy.r_
numpy.r
-
numpy.r_ =
-
Translates slice objects to concatenation along the first axis.
This is a simple way to build up arrays quickly. There are two use cases.
- If the index expression contains comma separated arrays, then stack them along their first axis.
- If the index expression contains slice notation or scalars then create a 1-D array with a range indicated by the slice notation.
If slice notation is used, the syntax
start:stop:step
is equivalent tonp.arange(start, stop, step)
inside of the brackets. However, ifstep
is an imaginary number (i.e. 100j) then its integer portion is interpreted as a number-of-points desired and the start and stop are inclusive. In other wordsstart:stop:stepj
is interpreted as