In NP -Array wie man Element als 1 erstellt, wenn es die Schwelle überschreitet

a = [0 if a_ > thresh else a_ for a_ in a]
Famous Flamingo