lundi 5 avril 2021

Numpy random array from 0 to 99, including both

I'm trying to create a np array with size (80,10) so each row has random values with range 0 to 99.

I've done that by

np.random.randint(99, size=(80, 10))

But I would like to always include both 0 and 99 as values in each row.

So two values in each row are already defined and the other 8 will be random.

How would I accomplish this? Is there a way to generate an array size (80,8) and just concatenate [0,99] to every row to make it (80,10) at the end?




Aucun commentaire:

Enregistrer un commentaire