Python中判断是一维数组仍是二维数组

若是直接用len,会发现len([1,2,4])为5 因此采用.ndim来获取数组维度 x = np.array([1, 2, 3, 4]) print(x.ndim) 最后答案:1web
相关文章
相关标签/搜索