NumPy - np.abs() - Absolute Value
The np.abs() function returns the absolute value of each element in a NumPy array. For real numbers, this is the non-negative value; for complex numbers, it returns the magnitude.
The np.abs() function returns the absolute value of each element in a NumPy array. For real numbers, this is the non-negative value; for complex numbers, it returns the magnitude.