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.

  1. If the index expression contains comma separated arrays, then stack them along their first axis.
  2. 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 to np.arange(start, stop, step) inside of the brackets. However, if step 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 words start:stop:stepj is interpreted as