How to pass multiple parameters to python function
Question: I have a numpy array with 300 entries. Within each entry is another numpy
array [2048 x 2048].

Each entry is a "tiff" entry (in matrix form) which corresponds to the pixel
position in a detector. Now, what I want to do is centralize this so that I
have an [2048 x 2048] array with each entry having 300 entries corresponding
to the pixels from the 300 frames.

I think I have found a way using the `zip` function. But, each time I get back
either a [300 x 2048 x 2048] or [2048 x 300 x 2048].

I want a [2048 x 2048 x 300]. I'm trying to do this in a rather economical and
pythonic way beyond simply reloading into a new array and reindexing.

    
    
    T_prime = zip(([list(t) for t in zip(*Tiffs)])) 
    

Where `Tiffs` is the array as described above.


Answer: In numpy we often add dimmensions to an array instead of using nested arrays
(which is the norm with lists for examples). Once you have all your data in a
single array, it's easy to operate on it. In your case it looks like you're
looking to transpose the array. An example:

    
    
    import numpy as np
    example_data = np.empty(30, dtype=object)
    for i in range(30):
        example_data[i] = np.zeros((100, 101))
    
    structured = np.array(list(example_data))
    
    print structured.shape
    # (30, 100, 101)
    print structured.transpose([1, 2, 0]).shape
    # (100, 101, 30)
    

