跳到主要内容

range

返回一个新的NdArray其范围为[top,left]->[bottom,right],step为间隔

声明

NdArray range(int top, int bottom, int left, int right, int row_step = 1, int col_step = 1)

参数

参数名描述
self代指当前的NdArray
top范围顶行号
bottom范围底行号
left范围左列号
right范围右列号
row_step行间隔
col_step列间隔

返回值

范围内矩阵

使用方式

// 从(0, 0)到(2, 5)范围内数据,行间隔为1,列间隔为2
ndarr2.range(0, 2, 0, 5, 1, 2).print();

返回文档