Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

numpy.sign() in Python

#Use numpy sign method will return array with corresponding signs
import numpy as np
arr = np.array([-10, 0, 15])
print(np.sign(arr))  # will return [-1, 0, 1]
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #Python
ADD COMMENT
Topic
Name
1+9 =