permutation#

scikitplot.random.permutation(self, x, axis=0)#

Randomly permute sequence or return permuted range.

Parameters:
xint or array-like

If int, permute np.arange(x). If array-like, permute copy of array.

axisint, default=0

Axis to permute along

Returns:
ndarray

Permuted sequence

See also

shuffle

In-place shuffle (destructive)

choice

Random sampling

Notes

Unlike shuffle(), this returns a permuted copy without modifying the input.

Examples

>>> gen = KissGenerator()
>>> gen.permutation(10)  # Permuted [0, 1, ..., 9]
array([3, 7, 1, 9, 2, 5, 8, 0, 6, 4])
>>>
>>> # Permute array (returns copy)
>>> arr = np.array([1, 2, 3, 4])
>>> gen.permutation(arr)
array([3, 1, 4, 2])
>>> arr  # Original unchanged
array([1, 2, 3, 4])