Filename: SURNAME_FIRSTNAME_MP2
Answer the questions or complete the tasks outlined in bold
below, use the specific method described if applicable.
1. Import NumPy as np
import numpy as np
2. Create an array of 20 zeros
import numpy as np
a = [Link](20, dtype = int)
print("Matrix a : \n", a)
3. Create an array of 20 ones
import numpy as np
a = [Link](20, dtype = int)
print("Matrix a : \n", a)
4. Create an array of 20 fives
import numpy as np
a = [Link](20, dtype = int)*5
print("Matrix a : \n", a)
5. Create an array of the integers from 10 to 70
import numpy as np
a = [Link](10,71)
print(“Matrix a : \n”, a)
6. Create an array of all the even integers from 10 to 70
import numpy as np
a = [Link](10,71,2)
print("Matrix a : \n", a)
7. Create a 3x3 matrix with values ranging from 10 to 18
import numpy as np
mat = [Link](10,19).reshape(3,3)
print("Matrix mat : \n", mat)
8. Create a 4x4 identity matrix
import numpy as np
mat = [Link](4, dtype=int)
print("Matrix mat : \n", mat)
9. Use NumPy to generate a random number between 0 and 5
from numpy import random
num=[Link](1,5)
print("The number generatedi is: ",num)
10. Use NumPy to generate an array of 50 random numbers
sampled from a standard normal distribution
import numpy as np
random_num = [Link](0,1,50)
print("50 random numbers from a standard normal distribution
SND:")
print(random_num)
Numpy Indexing and Selection
11. Run this Cell – This is our starting matrix
import numpy as np
matrix = [Link](1,51).reshape(5,10)
matrix
12. Get the sum of all the values in matrix
#write your code here
[Link]()
13. Get the standard deviation of the values in matrix
#write your code here
[Link]()