Python --函数 shape()和reshape()

shape()和reshape()都是数组array中的方法 1. shape() import numpy as np a = np.array([1,2,3,4,5,6,7,8]) #一维数组 print(a.shape[0]) #值为8,因为有8个数据 print(a.shape[1]) #IndexError: tuple index out of range a = np.arr
相关文章
相关标签/搜索