get_permutation#

skrough.permutations.get_permutation(start: int, stop: int, proba: Optional[ndarray] = None, seed: Optional[Union[int, SeedSequence, Generator]] = None) ndarray[source]#

Get permutation.

Get permutation of values between start (inclusively) and stop (exclusively) using the given probabilistic distribution proba for the values being permuted. The value of proba should be understood as follows:

  • when proba is given in a form of numpy.ndarray - it is treated as a discrete probabilistic distribution over values from start to stop (exclusively) and therefore it should sum to 1.0 and has the length equal to stop - start. The higher the probability value on the given position i, the more likely for element range(start, stop)[i] to appear earlier in the output permutation.

  • when proba is None - the uniform distribution is used

Parameters:
  • start – Start (inclusively) of the interval being permuted.

  • stop – Stop (exclusively) of interval being permuted.

  • proba – Probabilistic distribution for interval used to create permutation. Defaults to None.

  • seed – A seed to initialize random generator. Defaults to None.

Returns:

Output permutation.