shape[0]是第一维度元素个数,shape[1]是第二维度元素个数,对dataframe来讲,shape[0]就是行数,shape[1]就是列数。
group = np.array([[1.0, 1.1], [1.0, 1.0], [0, 0], [0, 0.1]]) print(group) group.shape[0] group.shape[1]

shape[0]是第一维度元素个数,shape[1]是第二维度元素个数,对dataframe来讲,shape[0]就是行数,shape[1]就是列数。
group = np.array([[1.0, 1.1], [1.0, 1.0], [0, 0], [0, 0.1]]) print(group) group.shape[0] group.shape[1]