Form a big 2d array from multiple smaller 2d arrays

前端 未结 5 668
囚心锁ツ
囚心锁ツ 2020-12-01 02:44

The question is the inverse of this question. I\'m looking for a generic method to from the original big array from small arrays:

array([[[ 0,  1,  2],
             


        
5条回答
  •  青春惊慌失措
    2020-12-01 02:52

    Yet another (simple) approach:

    threedarray = ...
    twodarray = np.array(map(lambda x: x.flatten(), threedarray))
    print(twodarray.shape)
    

提交回复
热议问题