l.z.lz
l.z.lz

Reputation: 393

How to form multi-dimentional array from several 2-d arrays in NumPy / PyTables?

I have several 2-dimentional arrays under a hdf5 file, how can I merge them together into one multi-dimentional array in PyTables?i.e., the file now is array A, arra yB, array C, i want them to be array X with 1st dimension A, 2nd dimension B, 3rd dimension C

Upvotes: 0

Views: 187

Answers (1)

heltonbiker
heltonbiker

Reputation: 27615

I think you are looking for numpy.dstack().

From the docs:

Stack arrays in sequence depth wise (along third axis).
Takes a sequence of arrays and stack them along the third axis to make a single array.
All of them must have the same shape along all but the third axis.

Hope this helps. Love Numpy!

Upvotes: 1

Related Questions