How to set all unmasked values to a certain value?
The condition (mask_array >= 0) & (mask_array < 0) can't match any cell. No value inside mask_array can be bigger or equal to 0 and smaller than 0 at the same time, so nothing matches => no changes
In Python I have a masked array, mask_array, and I want to set all remaining (unmasked) values to 1. When I do mask_array[(mask_array >= 0) & (mask_array < 0)= 1, the cells keep their original values and do not change to 1. When I do mask_array[mask_array>=0]=1, all cells including those I had masked originally change to 1. Why is this the case?
Is there a solution?