Session Ready
Exercise

Creating a 2D array

Multi-dimensional arrays can be useful for several tasks. In finance, for example, a 2D array may be used to store the prices and earnings for various companies. Let's create this 2D array, stock_array, from a list of prices and earnings.

numpy is imported as np and the two lists prices and earnings are available in your workspace.

Instructions 1/2
undefined XP
  • 1
  • 2
  • Create a two dimensional array of prices and earnings (in that order) and assign it to stock_array.
  • Print the shape of stock_array.