lundi 2 septembre 2019

I need to create a random binary matrix in python with some percentage p of the cells as 1?

I have to create a generator function which generates a random binary matrix with p% grids 1 and the rest 0. PROBLEM is I am not allowed to use libraries like numpy, pandas. Only standard libraries like random can be used. Any help would be highly appreciated




Aucun commentaire:

Enregistrer un commentaire