Using Python for data analysis (5) NumPy basics: ndarray index and slicing,

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.