Answers for "numpy randomize two numpy arrays"

0

apply same shuffle to two arrays numpy

def unison_shuffled_copies(a, b):
    assert len(a) == len(b)
    p = numpy.random.permutation(len(a))
    return a[p], b[p]
Posted by: Guest on December-01-2020
1

numpy generate random 2d array

import numpy as np
a=np.random.rand(3,3)
print(a)
Posted by: Guest on November-07-2020

Python Answers by Framework

Browse Popular Code Answers by Language