Using Python for data analysis (5) NumPy basics: ndarray index and slicing,
Concept understanding
IndexYou can use an unsigned integer to obtain the values in the array.SliceThat is, the description of a segment in a logarithm group.
One-dimensional array
Index of one-dimensional arrayThe indexing of one-dimensional arrays is similar to that of Python lists: Two-dimensional arrays
Two-dimensional array indexWhen you access a two-dimensional array by indexing one-dimensional array, the retrieved element is not a scalar but a one-dimensional array. Example: multi-dimensional array
Index of multi-dimensional arraysIn a one-dimensional array, a single index value returns the corresponding scalar; in a two-dimensional array, a single index value returns the corresponding one-dimensional array; then in a multi-dimensional array, A single index value returns an array with a lower latitude, for example, a Boolean index.
A boolean index refers to an array composed of Boolean values that can be used as an index of an array. The returned data is the value at the corresponding position of the True value, for example, a fancy index.
A fancy index refers to an index using an integer array. For example, the next article is about using Python for data analysis (6) NumPy basics: ndarray vector computation. If you are interested, please follow this blog, you are also welcome to add comments for discussion.