Arrays can be sliced just like lists and tuples. Array slicing is identical to list slicing, except that the syntax is simpler. Arrays are sliced using the `[ : , :, ... :]`

syntax, where the number of dimensions of the arrays determine the size of the slice, except that these dimensions for which slices are omitted, all elements are selected. For example, if `b`

is a three-dimensional array, `b[0:2]`

is the same as `b[0:2,:,:]`

. There are shorthand notations for slicing. Some common ones are:

**: and:**are the same as*0:n:1*, where*n*is the length of the array**m: and m:n:**are the same as*m:n:1*, where*n*is the length of the array**:n:**is the same as*0:n:1***::d:**is the same as*0:n:d*, where*n*is the length of the array

All these slicing methods have been referenced ...

Start Free Trial

No credit card required