So I have a bunch of 2d Numpy arrays in a list, and I want to make sure that they all have the same shape. I know that the second dimension is the same for each array, but the first dimension varies.
Say the shape of array X is (n,m) and the shape of array Y is (n+2,m). I would like to add two rows of zeros to array X so that X and Y are both (n+2,m).
What is the most Python-ic way to go through the list, making sure that all arrays have the same shape? Let's say I know what the largest value of the first dimension is for all arrays in the list - call it N - and, as I mentioned, I know that all arrays have a second dimension of m.
Thanks, everybody!