The list is not relevant.
The simplest way to reshape to the smallest valid shape is squeeze:
Test = np.array([[[1, 2, 3], [4, 5, 6], [7, 8, 9]]])
assert Test.shape == (1, 3, 3)
Test = Test.squeeze()
assert Test.shape == (3, 3)
By smallest valid size, I mean to eliminate all dimensions that have length 1. You can customize it to only pick specific axes to zero out, but in practice, I find the default behavior is most useful. A super-useful feature of squeeze is that it's idempotent. You can keep "squeezing" an array as many times as you want.
Bonus: The same function exists in pandas pd.DataFrame.squeeze where it gives you a pd.Series from a single column pd.DataFrame.
Test = Test[0][0]would give you(n,n)for any(1,n,n)np.squeeze()