1、shape
返回数组的行数和列数
2、shape[0]
返回数组的行数
3、shape[1]
返回数组的列数
4、img.shape[:2] 取彩色图片的高、宽
img.shape[:3] 取彩色图片的高、宽、通道
[start:stop:step ]
5、reshape(-1,1)表示(任意行,1列)
【Python】shape的用法
最新推荐文章于 2024-03-04 09:58:58 发布
1、shape
返回数组的行数和列数
2、shape[0]
返回数组的行数
3、shape[1]
返回数组的列数
4、img.shape[:2] 取彩色图片的高、宽
img.shape[:3] 取彩色图片的高、宽、通道
[start:stop:step ]
5、reshape(-1,1)表示(任意行,1列)