mardi 8 décembre 2020

Python: searching a sequence (1,1,2) in a numpy vector (contains random 0,1,2 numbers) with for loop:

The code I have tried

rand_array2 = np.random.randint(0,3, size=1000)
rand_array2

Searching for a way that allows me to count the (1,1,2) Sequences in rand_array2 with a for a loop.




Aucun commentaire:

Enregistrer un commentaire