A positive integer, which stands for the (idx) column or row of (arr)
required
axis
int
If axis is 1, two random elements will be exchanged within column (idx). If axis is 0, two random elements will be exchanged within row (idx). Defaults to axis = 1.
1
seed
Optional[Union[int, np.random.Generator]])
If seedis an integer or None, a new numpy.random.Generator is created using np.random.default_rng(seed). If seed is already a `Generator instance, then the provided instance is used. Defaults to None.
None
Returns
Type
Description
numpy.numpy.ndarray
A new design matrix after the swap of elements
Examples: Choose the first columns of random_lhd and swap two randomly selected elements