NumPy笔记:创建ndarray数组(array,asarray,copy)

import numpy as np
a = np.array([[1, 1, 1, 2, 2, 2]])
a1 = np.array(a)
a2 = np.asarray(a)
a3 = np.copy(a)
print("a1:", a1)
print("a2:", a2)
print("a3:", a3)
 

 

a1: [[1 1 1 2 2 2]]
a2: [[1 1 1 2 2 2]]
a3: [[1 1 1 2 2 2]]

 

posted @ 2019-09-10 22:34  Jumpkin1122  阅读(227)  评论(0编辑  收藏  举报