Array of arrays (Python/NumPy)

前端 未结 4 1454
北荒
北荒 2021-01-01 12:56

I am using Python/NumPy, and I have two arrays like the following:

array1 = [1 2 3]
array2 = [4 5 6]

And I would like to create a new array

4条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-01 13:12

    a=np.array([[1,2,3],[4,5,6]])

    a.tolist()

    tolist method mentioned above will return the nested Python list

提交回复
热议问题