撰写时间:2017.5.23
一维数组
1.numpy初始化一维数组
a = np.array([1,2,3]);
print a.shape
输出的值应该为(3,)
二维数组
2.numpy初始化二维数组
a = np.array([[1,2,3]]);
b = np.array([[1],[2],[3]]);
print a.shape//(1,3)
print b.shape//(3,1)
注意(3,)和(3,1)的数组是不一样的,前者是一维数组,后者是二维数组。
拼接
3.numpy有很多的拼接函数。比如hstack和vstack等。网上又很多这样的总结帖子。但是两个数组能拼接的