Angel - Assignment 2
Angel - Assignment 2
5. Write code which creates a 3d NumPy array with shape (2, 3, 4). The array will have 24
elements. The first element should be 1, the second 2, the third 3 and so on till the 24th
element. (2 pts)
Output
6. What is the element at (0, 2, 3) in the 3d NumPy array above? What is the element at (1, 3,
3)? (1 pt)
Element at (0, 2, 3): 12 Element at(1,3,3): The above position is out of bounds for the array.
7. Suppose you have a NumPy array from np.array([ [1, 2], [3, 4], [5, 6] ]). How will you create a
3-element array comprising the elements 1, 3, and 6 using integer indexing? (0.5 pt)
10. Generate a plot that shows the month-by-month depreciation/appreciation of the cedi
against the US Dollar and British Pound for the year 2022. You can find the historical
exchange rates here: BOG Cedi Rates, 2022 (2 pts)