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


Picture showing the output of copysign function in numpy
Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Thursday, June 6, 2019

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250