2021年4月4日星期日

Numpy random array from 0 to 99, including both

I'm trying to create an 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?

https://stackoverflow.com/questions/66946748/numpy-random-array-from-0-to-99-including-both April 05, 2021 at 07:31AM

没有评论:

发表评论