samedi 15 août 2020

How can I generate in Python a matrix with n random elements between 1 and 30 and the rest of the elements equal to zeros?

I have to generate a matrix with of shape 10^4 x 10^4 with 100 integer items randomly chosen 1 and 30 and the rest of the elements equals to 0. Can anybody help me? :pray




Aucun commentaire:

Enregistrer un commentaire