How to add a new row to an empty numpy array

前端 未结 6 584
旧时难觅i
旧时难觅i 2020-11-28 01:13

Using standard Python arrays, I can do the following:

arr = []
arr.append([1,2,3])
arr.append([4,5,6])
# arr is now [[1,2,3],[4,5,6]]

Howev

6条回答
  •  北海茫月
    2020-11-28 01:54

    Here is my solution:

    arr = []
    arr.append([1,2,3])
    arr.append([4,5,6])
    np_arr = np.array(arr)
    

提交回复
热议问题