Session Ready
Exercise

Practice with NumPy arrays

Let's practice slicing numpy arrays and using NumPy's broadcasting concept. Remember, broadcasting refers to a numpy array's ability to vectorize operations, so they are performed on all elements of an object at once.

A two-dimensional numpy array has been loaded into your session (called nums) and printed into the console for your convenience. numpy has been imported into your session as np.

Instructions 1/2
undefined XP
  • 1
  • 2
  • Print the second row of nums.
  • Print the items of nums that are greater than six.
  • Create nums_dbl that doubles each number in nums.
  • Replace the third column in nums with a new column that adds 1 to each item in the original column.