December 2017
Intermediate to advanced
386 pages
10h 42m
English
A slice is a reference to a subset of the elements in an array. Slices allow access to subranges of equally spaced items across each axis of the array. For example, the following code accesses a subset of elements on contiguous rows and columns of the array x:
y = x[2:4, 3:6]dumpArray(y)
This will produce the following output:
23 24 2533 34 35
Notice that, as is the case with ranges, the slice does not include its rightmost index. Thus, for instance, the slice 3:6 refers items at positions 3, 4, and 5.
Read now
Unlock full access