Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
Python
in np array how to make element as 1 if it exceeds the threshold
Sam
Programming language:
Python
2021-07-17 12:33:34
0
Q:
in np array how to make element as 1 if it exceeds the threshold
Saad Lulu
Code:
Python
2021-06-24 10:56:44
a = [0 if a_ > thresh else a_ for a_ in a]
0
Tags
array
element
make
how
Related
numpy array with 2 times each value
sum every ith element numpy
New to Communities?
Join the community