NumPy Array Indexing
In this lesson, array indexing in NumPy is explained.
We'll cover the following...
We'll cover the following...
Indexing for a 1-D array
Just like normal arrays, elements of a NumPy array can also be accessed and changed through indexing. Through NumPy indexing, we can also access and change elements in a specific range.
The following code snippet provides an example of all these functionalities:
Note: The
:inside the[]defines the range. The value to the left is the starting index and is inclusive. Meanwhile, the value on the right defines the ending index, which is exclusive; exclusive means that the value at the end index will not be considered for the ...