Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

check odd numbers numpy

# Input
arr = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
arr[arr % 2 == 1]
#> array([1, 3, 5, 7, 9])
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #check #odd #numbers #numpy
ADD COMMENT
Topic
Name
2+7 =