Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
Whatever
check odd numbers numpy
engstu
Programming language:
Whatever
2021-07-22 06:55:01
0
Q:
check odd numbers numpy
ThomasMcLeod
Code:
Whatever
2021-07-20 14:03:49
# Input arr = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) arr[arr % 2 == 1] #> array([1, 3, 5, 7, 9])
0
Tags
number
check
Related
how to check if number is even
Check if a Number is Odd or Even using Bitwise Operators
Given an array of integers, find the one that appears an odd number of times. There will always be only one integer that appears an odd number of times
display array of odd rows and even columns in numpy
check odd number
New to Communities?
Join the community