NumPy Basics - Array Indexing and Slicing
We'll cover the following...
3. Array Indexing: Accessing Single Elements
If we want to get and set the values of individual elements in the array, we need to be able to access single elements, correct? Accessing single elements is called indexing arrays.
Indexing in NumPy is similar to Python’s standard list indexing. In a 1D array, we can access the ith value by specifying the index of the element we need in square brackets. One important thing to remember here is that indexing in Python starts at zero.
Observe the inputs and outputs (indicated by “ ...