Articles → Numpy → Copysign Function In Numpy
Copysign Function In Numpy
Purpose
Example
import numpy as np
num1 = 10
num2 = -20
print("After copying the sign of num2, num1 is:", np.copysign(num1,num2))
print("After copying the sign of num1, num2 is:", np.copysign(num2,num1))
Output
Click to Enlarge