NumPy | sqrt method
Start your free 7-days trial now!
sqrt(~) method computes the square root of each value in the input array.
The input array.
Numpy array |
Instead of creating a new array, you can place the computed result into the array specified by
Values that are flagged as False will be ignored, that is, their original value will be uninitialized. If you specified the out parameter, the behavior is slightly different - the original value will be kept intact.
A scalar is returned if
a is a scalar, otherwise a Numpy array is returned.
x = np.array([1,4,25])np.sqrt(x)array([1., 2., 5.])