SyntaxFix
Write A Post
Hire A Developer
Questions
I think you can achieve this the quickest by using the where function:
where
For example looking for items greater than 0.2 in a numpy array and replacing those with 0:
import numpy as np nums = np.random.rand(4,3) print np.where(nums > 0.2, 0, nums)