📜  从 numpy 到列表 python 代码示例

📅  最后修改于: 2022-03-11 14:47:08.896000             🧑  作者: Mango

代码示例1
import numpy as np

# 1d array to list
arr = np.array([1, 2, 3])
print(f'NumPy Array:\n{arr}')
#NumPy Array: [1 2 3]

list1 = arr.tolist()
print(f'List: {list1}')
#List: [1, 2, 3]