O'Reilly logo

Hands-On Data Analysis with NumPy and pandas by Curtis Miller

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Selecting elements explicitly

If you know how to select subsets of Python lists, you know most of what you need to know about ndarray slicing. The elements of the array being indexed that correspond to the elements of the indexing object are returned in a new array. The most important aspect of indexing is to remember that there is more than one dimension, and the indexing method should be able to handle these other dimensions.

Remember the following points while selecting elements explicitly:

Separate the indexing objects for different dimensions with a comma; the object before the first comma shows how the first dimension is indexed. After ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required