January 2019
Beginner
318 pages
8h 23m
English
The indexing of arrays is done using an array as an index. With an index array, a copy of the original array is returned. numpy arrays can be indexed using any other sequence or by using any other array, excluding tuples. The last element in the array can be indexed by -1 and the second last element can be indexed by -2, and so on.
So, to perform indexing operations on the array, first we create a new numpy array and for that we are going to use the range() function to create the array, as shown here:
student@ubuntu:~$ python3Python 3.6.7 (default, Oct 22 2018, 11:32:17)[GCC 8.2.0] on linuxType "help", "copyright", "credits" or "license" for more information.>>> import numpy as np>>> arr = np.arange(0,16)>>> arrarray([ 0, 1, ...
Read now
Unlock full access