dask 2021.10.0

ParametersReturnsBackRef
permutation(self, x)

This docstring was copied from numpy.random.mtrand.RandomState.permutation.

Some inconsistencies with the Dask version may exist.

If x is a multi-dimensional array, it is only shuffled along its first index.

note

New code should use the permutation method of a default_rng() instance instead; please see the :None:ref:`random-quick-start`.

Parameters

x : int or array_like

If x is an integer, randomly permute np.arange(x) . If x is an array, make a copy and shuffle the elements randomly.

Returns

out : ndarray

Permuted sequence or array range.

Randomly permute a sequence, or return a permuted range.

See Also

Generator.permutation

which should be used for new code.

Examples

This example is valid syntax, but we were not able to check execution
>>> np.random.permutation(10)  # doctest: +SKIP
array([1, 7, 4, 3, 0, 9, 2, 5, 8, 6]) # random
This example is valid syntax, but we were not able to check execution
>>> np.random.permutation([1, 4, 9, 12, 15])  # doctest: +SKIP
array([15,  1,  9,  4, 12]) # random
This example is valid syntax, but we were not able to check execution
>>> arr = np.arange(9).reshape((3, 3))  # doctest: +SKIP
... np.random.permutation(arr) # doctest: +SKIP array([[6, 7, 8], # random [0, 1, 2], [3, 4, 5]])
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

dask.array.random.RandomState.choice

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/random.py#358
type: <class 'function'>
Commit: