Complete the code to calculate the square root of 16 using numpy.
import numpy as np result = np.[1](16) print(result)
The function np.sqrt() calculates the square root of a number.
Complete the code to calculate the square root of each element in the numpy array.
import numpy as np arr = np.array([4, 9, 25]) roots = np.[1](arr) print(roots)
np.square() which squares elements instead.np.root().np.sqrt() works element-wise on numpy arrays to find square roots.
Fix the error in the code to correctly compute the square root of 49.
import numpy as np value = 49 result = np.[1](value) print(result)
np.square() which squares the number instead of finding the root.np.pow() without the correct exponent.The correct function to compute square root is np.sqrt().
Fill both blanks to create a dictionary with numbers as keys and their square roots as values.
import numpy as np numbers = [1, 4, 9, 16] sqrt_dict = { [1]: np.[2](num) for num in numbers } print(sqrt_dict)
np.square() instead of np.sqrt().Use num as the key and np.sqrt() to get the square root values.
Fill all three blanks to create a list of square roots for numbers greater than 10.
import numpy as np nums = [4, 16, 25, 9, 36] sqrt_list = [np.[1](n) for n in nums if n [2] [3]] print(sqrt_list)
np.square() instead of np.sqrt().Use np.sqrt() to get square roots, and filter numbers greater than 10 with n > 10.
