Flatten numpy array with sub-arrays of different dimensions

前端 未结 1 1133
没有蜡笔的小新
没有蜡笔的小新 2021-01-04 07:31

This seems like a simple enough task, but I haven\'t found how to do it using numpy. Consider the example array:

import numpy as np
aa = np.arra         


        
相关标签:
1条回答
  • 2021-01-04 08:25

    You can use numpy.hstack

    >>> np.hstack(aa)
    array([13.16,  1.58,  1.2 , 13.1 ,  1.  ,  2.6 ])
    
    0 讨论(0)
提交回复
热议问题