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) andstop(exclusively) using the given probabilistic distributionprobafor the values being permuted. The value ofprobashould be understood as follows:when
probais given in a form ofnumpy.ndarray- it is treated as a discrete probabilistic distribution over values fromstarttostop(exclusively) and therefore it should sum to1.0and has the length equal tostop - start. The higher the probability value on the given positioni, the more likely for elementrange(start, stop)[i]to appear earlier in the output permutation.when
proba is None- the uniform distribution is used
- Parameters:
- Returns:
Output permutation.