numpy.rollaxis() in Python

The numpy.rollaxis() function rolls the given axis backwards until it lies in the specified position.

Syntax

Parameter

The numpy. rollaxis() method consists of three parameters, which are as follows:

a : It represents an input array.

axis : The parameter axis is used to roll backwards. The positions of the other axes do not change relative to one another.

start : It is an optional integer parameter. The axis is rolled until it lies before the start position. The default value is 0, which signifies a “complete” roll.

Return

This function returns a view of parameter ‘a’. 

Example 1

Output

Pin It on Pinterest

Share This