1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Python

Connected

Exercise

Subsetting NumPy Arrays

Subsetting (using the square bracket notation on lists or arrays) works exactly the same with both lists and arrays.

This exercise already has two lists, height_in and weight_lb, loaded in the background for you. These contain the height and weight of the MLB players as regular lists. It also has two numpy array lists, np_weight_lb and np_height_in prepared for you.

Instructions

100 XP
  • Subset np_weight_lb by printing out the element at index 50.
  • Print out a sub-array of np_height_in that contains the elements at index 100 up to and including index 110.