MCPcopy Create free account
hub / github.com/dask/dask / permutation

Method permutation

dask/array/_array_expr/random.py:658–666  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

656
657 @derived_from(np.random.RandomState, skipblocks=1)
658 def permutation(self, x):
659 from dask.array.slicing import shuffle_slice
660
661 if isinstance(x, numbers.Number):
662 x = arange(x, chunks="auto")
663
664 index = np.arange(len(x))
665 self._numpy_state.shuffle(index)
666 return shuffle_slice(x, index)
667
668 @derived_from(np.random.RandomState, skipblocks=1)
669 def poisson(self, lam=1.0, size=None, chunks="auto", **kwargs):

Callers

nothing calls this directly

Calls 4

arangeFunction · 0.90
shuffle_sliceFunction · 0.90
arangeMethod · 0.45
shuffleMethod · 0.45

Tested by

no test coverage detected