Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

numpy sign method

# sign method return 0 if the values in the array is 0,
# 1 is the value is greater than 0
# and -1 when the value is less than 0
import numpy as np

arr = [-10, 0, 15]

print(arr.sign) # will return [-1, 0, 1]
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #numpy #sign #method
ADD COMMENT
Topic
Name
3+1 =