dpnp.random.permutation

dpnp.random.permutation(x)[source]

Randomly permute a sequence, or return a permuted range.

For full documentation refer to numpy.random.permutation.

Examples

>>> arr = dpnp.random.permutation(10)
>>> print(arr)
[3 8 7 9 0 6 1 2 4 5] # random
>>> arr = dpnp.random.permutation([1, 4, 9, 12, 15])
>>> print(arr)
[12  1  4  9 15] # random
>>> arr = dpnp.arange(9).reshape((3, 3))
>>> dpnp.random.permutation(arr)
>>> print(arr)
[[0 1 2]
 [3 4 5]
 [6 7 8]]  # random