SyntaxFix
Write A Post
Hire A Developer
Questions
You are halfway there. Try:
In [4]: a[a < 0] = 0 In [5]: a Out[5]: array([1, 2, 3, 0, 5])