You can find absolute value in the NumPy with the following code. If you want to learn Python, I highly recommend reading This Book.
Example 1
import numpy as np a = np.array([-5, 10, -1.2, -0.6, 0.2 ]) b = np.absolute(a) print(b)
[ 5. 10. 1.2 0.6 0.2]
Example 2
import numpy as np a = np.array([[5 + 2j], [5j], [2 + 3j]]) b = np.absolute(a) print(b)
[[5.38516481] [5. ] [3.60555128]]
People are also reading:
What is Computer Vision? Examples, Applications, Techniques
Books for Machine Learning (ML)