Suppose I have the following data
dictData = {} or []
dictData[0] = [1,2,3]
dictData[1] = [10,11,12,13]
dictData[2] = [21,22]
With these data, I want to generate unique 1d arrays that contain randomly selected elements from each of the different arrays. The amount of arrays to be generated is the number of elements in the largest array. All of the elements in the array must be displayed at least once. Elements can be repeated, if all the elements in an array are already used once. The positions from each of the arrays are preserved (eg. a value taken from array 2 is placed at index 2)
A possible outcome is as shown below
possibleOutput = [1,10,21],[1,11,22],[3,12,21],[2,13,21]
I had previously implemented a naive method using a "for" loop starting with the biggest array and just picking one number from each array until exhausted. Is there a more efficient(maybe numpy) way to achieve the same results?