本文主要是关于numpy的一些基本运算的用法。
#!...[[1, 2, 3],
[4, 5, 6]])
print arr
# Test 1 Result
[[1 2 3]
[4 5 6]]
# Test 2
# 矩阵的维度...print 'number of dim: ', arr.ndim
# 矩阵的shape,即每一维度上的元素个数
print 'shape: ', arr.shape
# 矩阵的元素总数
print...'size: ', arr.size
# 矩阵的元素类型
print 'dtype: ', arr.dtype
# Test 2 Result
number of dim: 2
shape: (2..., 3)
size: 6
dtype: int64
# Test 3
# 定义矩阵及矩阵的元素类型——int32, int64, float32, float64
a = np.array([1,