So I have a function that will generate a series of pairs. For this example I am using: [11,1], [9,9], [11,1]
and the amount of pairs will be greater than or equal to three.
I am trying to create an array that shows every possible combination of these pairs. When I run:
import numpy as np
np.array(np.meshgrid([11,1], [9,9], [11,1])).T.reshape(-1,3)
It produces a correct output of:
array([[11, 9, 11],
[11, 9, 11],
[ 1, 9, 11],
[ 1, 9, 11],
[11, 9, 1],
[11, 9, 1],
[ 1, 9, 1],
[ 1, 9, 1]])
However, since the input can vary, I'd like to store this pair information as a variable and simply plug it into a function for it to work. And no variable type that I've input into the function containing the pairs seems to output the correct information.
Any help with this would be much appreciated!