I have a tuple which contains many tuples. Each tuple within my main tuple has two elements -- the first element is an array with a shape of (700,) and the second element is a integer.
Here is a small representation of my tuple:
x =( (np.array[3,3,3],1), (np.array[4,4,4],2), (np.array[5,5,5],3))
I'm looking to combine all the arrays into one big matrix, and all the integers into one column vector, which all fit into one tuple.
So my output should be something like this:
y= (np.array([[3,3,3],[4,4,4], [5,5,5]]), np.array([1,2,3]))
One tuple with the first element as an array with shape (3,3), and the second element as an array with a shape of (3,)
I'm assuming we can use one of numpy's stack methods but I can't wrap my head around how to access all elements of the tuples to do so.
Thank you.
[and]s and just pretend they wrote it with the spacing as two separate arrays.