主要调用numpy的tolist()方法,可参考下面的例子:
import numpy as np
arr=np.array([0,1,2,3,4,5,6,7,8,9])
lst=arr.tolist()
type(lst)
#<class 'list'>
print(lst)
#[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
主要调用numpy的tolist()方法,可参考下面的例子:
import numpy as np
arr=np.array([0,1,2,3,4,5,6,7,8,9])
lst=arr.tolist()
type(lst)
#<class 'list'>
print(lst)
#[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]