xxxxxxxxxx
import numpy as np
arr = np.random.uniform(0, 1, 10000)
#Inverse Square Root
1 / np.sqrt(arr)
xxxxxxxxxx
Return the non-negative square-root of an array, element-wise.
// Examples
>>> np.sqrt([1,4,9])
array([ 1., 2., 3.])
>>> np.sqrt([4, -1, -3+4J])
array([ 2.+0.j, 0.+1.j, 1.+2.j])
>>> np.sqrt([4, -1, np.inf])
array([ 2., nan, inf])
xxxxxxxxxx
import matplotlib.pyplot as plt, numpy as np
square = np.zeros((80, 80, 1)) # Black 80x80 image with 1 color_channel
square[20:60, 20:60] = 1.0 # Turn pixels white in region[20:60, 20:60]
plt.imshow(square, cmap='gray'); plt.show()
xxxxxxxxxx
'''numpy. sqrt(array[, out]) function is used to
determine the positive square-root of
an array, element-wise.'''