let’s say we want to compute the square root of the identity matrix, how would you do in python? I have tried numpy.sqrt() but it didn’t work. Any ideas? Thanks a lot!
>Solution :
If you want to do this element wise you can use
import numpy as np
my_matrix = np.array([0, 4, 9])
sqrt_my_matrix = np.sqrt(my_matrix)
print(sqrt_my_matrix)