numpy.absolute(arr, out = None, ufunc 'absolute') : This mathematical function helps user to calculate absolute value of each element. For complex input, a + ib, the absolute value is .
Parameters :
arr : [array_like] Input array or object whose elements, we need to test.
Return :
An array with absolute value of each array.
Code #1 : Working
Output :
Absolute Value of arr1 :
[ 1 3 15 466]
Absolute Value of arr2 :
[23 56]
Code #2 : Working with complex numbers
Output :
Absolute(4 + 3j) : 5.0
Absolute value(16 + 13j) : 20.6155281281
Code #3: Graphical Representation of numpy.absolute()