How can I generate a Random (N*M) 0's and 1's Matrix in which the sum of each row equals to 10? (in python using numpy)
for example for 10*10(N*M)
matrix we can use:
import numpy as np
np.random.randint(2, size=(10, 10))
but I want sum of each rows equals to 10
Aucun commentaire:
Enregistrer un commentaire