(base) C:\Users\凌安>python
Python 3.7.3 (default, Mar 27 2019, 17:13:21) [MSC v.1915 64 bit (AMD64)] :: Ana
conda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> c = np.array([[[1,1],[1,2],[1,3],[1,4]],[[1,1],[1,2],[1,3],[1,4]]])
>>> c
array([[[1, 1],
[1, 2],
[1, 3],
[1, 4]],
[[1, 1],
[1, 2],
[1, 3],
[1, 4]]])
>>> c.shape
(2, 4, 2)
>>> c = np.array([[[1,1],[1,2],[1,3],[1,4]],[[1,1],[1,2],[1,3],[1,4]],[[1,1],[1,
2],[1,3],[1,4]]])
>>> c.shape
(3, 4, 2)
上面这个(3, 4, 2)三维数组就可以看作3个4*2的二维矩阵。
网友评论