Let’s see how to calculate square root in Numpy Python module.
Numpy sqrt
Import Numpy, use sqrt numpy function and calculate square root for your array just like in the numpy code below.
import numpy as np my_array = np.array([2, 3, 4, 9, 16]) square_root = np.sqrt(my_array) print("Square root equals: " + str(square_root))
Square root has been calculated and printed out.