dask 2021.10.0

NotesParametersReturns
transpose(a, axes=None)

This docstring was copied from numpy.transpose.

Some inconsistencies with the Dask version may exist.

For an array a with two axes, transpose(a) gives the matrix transpose.

Refer to :None:None:`numpy.ndarray.transpose` for full documentation.

Notes

Use :None:None:`transpose(a, argsort(axes))` to invert the transposition of tensors when using the :None:None:`axes` keyword argument.

Transposing a 1-D array returns an unchanged view of the original array.

Parameters

a : array_like

Input array.

axes : tuple or list of ints, optional

If specified, it must be a tuple or list which contains a permutation of [0,1,..,N-1] where N is the number of axes of a. The i'th axis of the returned array will correspond to the axis numbered axes[i] of the input. If not specified, defaults to range(a.ndim)[::-1] , which reverses the order of the axes.

Returns

p : ndarray

a with its axes permuted. A view is returned whenever possible.

Reverse or permute the axes of an array; returns the modified array.

See Also

argsort
moveaxis
ndarray.transpose

Equivalent method

Examples

This example is valid syntax, but we were not able to check execution
>>> x = np.arange(4).reshape((2,2))  # doctest: +SKIP
... x # doctest: +SKIP array([[0, 1], [2, 3]])
This example is valid syntax, but we were not able to check execution
>>> np.transpose(x)  # doctest: +SKIP
array([[0, 2],
       [1, 3]])
This example is valid syntax, but we were not able to check execution
>>> x = np.ones((1, 2, 3))  # doctest: +SKIP
... np.transpose(x, (1, 0, 2)).shape # doctest: +SKIP (2, 1, 3)
This example is valid syntax, but we were not able to check execution
>>> x = np.ones((2, 3, 4, 5))  # doctest: +SKIP
... np.transpose(x).shape # doctest: +SKIP (5, 4, 3, 2)
See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /dask/array/routines.py#170
type: <class 'function'>
Commit: