I want to generate a random array of size N which only contains 0 and 1, I want my array to have some ratio between 0 and 1. For example, 90% of the array be 1 and the remaining 10% be 0 (I want this 90% to be random along with the whole array).
right now I have:
randomLabel = np.random.randint(2, size=numbers)
But I can't control the ratio between 0 and 1.