如何在NumPy / PyTables中从几个2d数组形成多维数组?

时间:2012-05-18 07:41:59

标签: multidimensional-array numpy hdf5 pytables

我在hdf5文件下有几个二维数组,如何在PyTables中将它们合并为一个多维数组?即,文件现在是数组A,arra yB,数组C,我希望它们是阵列X具有第一维A,第二维B,第三维C

1 个答案:

答案 0 :(得分:1)

我认为您正在寻找numpy.dstack()

来自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.

希望这会有所帮助。爱Numpy!