问题
I have the following problem in python: I have several numpy 2d-arrays where all have same number of columns ,but different number of rows.I want to index all these 2d-array in a unique numpy 3d-array where the first index keeps into account each 2d-array. For example : let's suppose I got two 2d-arrays like this : [[1,2,3][4,5,6][7,8,9]] (3X3 array) [[11,12,13][14,15,16]] (2X3 array)
I want to get a numpy 3d-array name,for example, c where : c[0] has shape (3,3), c[1] (2,3) and so on...So I expect a 3d-array whose shape is (number of 2d matrices,number of rows of one matrix,number of columns of one matrix)
How can I reshape since each 2d-arrays have different number of rows each other? Thanks
来源:https://stackoverflow.com/questions/52024847/how-to-index-several-2d-numpy-arrays-with-different-number-of-rows-in-a-3d-array