我正在尝试 numpy 数组的功能,下面是代码:
import numpy as np
Z =np.array(
[[0,4,0,0,0,0],
[0,0,0,1,0,0],
[0,1,0,1,0,0],
[0,0,1,1,0,0],
[0,0,0,0,0,0],
[0,0,0,0,0,0]])
print Z
print Z.dtype
print Z.shape
这给出了:
[[0 4 0 0 0 0]
[0 0 0 1 0 0]
[0 1 0 1 0 0]
[0 0 1 1 0 0]
[0 0 0 0 0 0]
[0 0 0 0 0 0]]
int32
(6L, 6L)
它是一个 6 行 6 列的整数数组。但是 numpy.type 中的 32 和 numpy.shape 中的 L 是什么?