Python numpy array of numpy arrays

后端 未结 2 1066

I\'ve got a problem on creating a numpy array of numpy arrays. I would create it in a loop:

a=np.array([])
while(...):
   ...
   b= //a numpy array generated         


        
2条回答
  •  醉梦人生
    2020-12-10 02:16

    we can try it also :

    arr1 = np.arange(4)
    arr2 = np.arange(5,7)
    arr3 = np.arange(7,12)
    
    array_of_arrays = np.array([arr1, arr2, arr3])
    array_of_arrays
    np.concatenate(array_of_arrays)
    

提交回复
热议问题