pyhton——列表转换为数组

import numpy as np
X=[[1,2,3,4],[5,6,7,8],[9,0,11,12]]
'列表转换为数组'
Y=np.array(X)
print(Y)

#输出结果
# [[ 1  2  3  4]
#  [ 5  6  7  8]
#  [ 9  0 11 12]]

 

你可能感兴趣的:(python,列表,数组)