【NumPy学习】03: 数组属性

import numpy as np #1 ndarray.ndim 用于返回数组的维数,等于秩。 a1 = np.arange(24) print(a1.ndim) # a 现只有一个维度 # 如今调整其大小 # reshape(self, shape, order) b1 = a1.reshape(2,4,3) # b 如今拥有三个维度 print(b1.ndim) #2 ndarr
相关文章
相关标签/搜索