samedi 4 juin 2022

How many time can you fit one array to a specific size array (python)

I want to create a randomized array that contains another array few times, So if:

Big_Array = np.zeroes(5,5)
Inner_array = no.array([[1,1,1],
                        [2,1,2]])

And if we want 2 Inner_array it could look like:

Big_Array = [[1,2,0,0,0], 
             [1,1,0,0,0], 
             [1,2,0,0,0], 
             [0,0,2,1,2], 
             [0,0,1,1,1]]

I would like to write a code that will A. Tell whether the bigger array can fit the required amount of inner arrays, and B. place randomly the inner array (in random rotations) x amount of times in the big array without overlap Thanks in advance!




Aucun commentaire:

Enregistrer un commentaire