Your can use NumPy’s array indexing:
def unison_shuffled_copies(a, b):
assert len(a) == len(b)
p = numpy.random.permutation(len(a))
return a[p], b[p]
This will result in creation of separate unison-shuffled arrays.
More Related Contents:
- What are the advantages of NumPy over regular Python lists?
- Shuffling a list of objects
- How do I get indices of N maximum values in a NumPy array?
- Why does random.shuffle return None?
- How to convert a PIL Image into a numpy array?
- Convert array of indices to 1-hot encoded numpy array
- How does numpy.newaxis work and when to use it?
- Concatenating two one-dimensional NumPy arrays
- Shuffle an array with python, randomize array item order with python
- How do I convert a PIL Image into a NumPy array?
- Convert array of indices to one-hot encoded array in NumPy
- Convert NumPy array to Python list
- Check if two 3D numpy arrays contain overlapping 2D arrays
- Deprecation status of the NumPy matrix class
- How to specify upper and lower limits when using numpy.random.normal
- How to get a normal distribution within a range in numpy? [duplicate]
- What is the difference between ndarray and array in NumPy?
- Creating same random number sequence in Python, NumPy and R
- Why using an array as an index changes the shape of a multidimensional ndarray?
- How do I calculate percentiles with python/numpy?
- How to generate a random normal distribution of integers
- Weighted random sample without replacement in python
- Python – shuffle only some elements of a list
- Numpy shuffle multidimensional array by row only, keep column order unchanged
- How does the axis parameter from NumPy work?
- Vectorizing `numpy.random.choice` for given 2D array of probabilities along an axis
- Maximal Length of List to Shuffle with Python random.shuffle?
- How to convert a 3d numpy array to 2d
- Avoid overflow when adding numpy arrays
- Can Python’s set absence of ordering be considered random order?