Answers for "in np array how to make element as 1 if it exceeds the threshold"

0

in np array how to make element as 1 if it exceeds the threshold

a = [0 if a_ > thresh else a_ for a_ in a]
Posted by: Guest on October-18-2020
0

in np array how to make element as 1 if it exceeds the threshold

a = [0 if a_ > thresh else a_ for a_ in a]
Posted by: Guest on October-18-2020

Python Answers by Framework

Browse Popular Code Answers by Language