mercredi 17 juin 2020

Creating new array in python by randomly selecting values from other N arrays

The code would be something like this:

  for bi in range(N):
     for no in range(M):
        bn = random.randrange(N)
        ar[bi][no] = br[bn][no]

but this is quite inefficient in python. Any ideas?




Aucun commentaire:

Enregistrer un commentaire