jeudi 20 septembre 2018

Creating random Variables in Python with one third of the array to be zero

I want to create random variables in python and used the following below code weights = np.random.random(10) but I want to create random variables such that one third of the weights should be zero. Is there any way possible? I have also tried below code but this is not what I want
weights = np.random.random(7) weights.append(0, 0, 0)




Aucun commentaire:

Enregistrer un commentaire