Exercises
Contents
7.2. Exercises#
import numpy as np
7.2.1. Exercise 1#
Do you think 2**np.array([1,2,3])
will work?
# write your code here
7.2.2. Exercise 2#
Using numpy arrays find the cubes of the numbers from 11 to 19.
# write your code here
7.2.3. Exercise 3#
Given the 3x3 matrix of numbers from 1 to 9, find the average per row.
matrix = np.arange(1,10).reshape(3,3)
# write your code here
7.2.4. Exercise 4#
Given the 3x3 matrix of numbers from 1 to 9, find the average per columns.
matrix = np.arange(1,10).reshape(3,3)
# write your code here
7.2.5. Exercise 5#
Given the 3x3 matrix of numbers from 1 to 9, find a way using slicing to select the highlighted elements in the Fig. 7.4.

Fig. 7.4 Special Slicing#
matrix = np.arange(1,10).reshape(3,3)
# write your code here