surprising behavior of np.asarray on masked arrays
6 Dec
2013
6 Dec
'13
3:14 a.m.
Hi, If I pass a masked array through np.asarray, I get original unmasked array. Example: test = np.array([[1, 0], [-1, 3]]) testMasked = ma.masked_less_equal(test, 0) print testMasked [[1 --] [-- 3]] print testMasked.fill_value 999999 print np.asarray(testMasked) [[ 1 0] [-1 3]] Is this behavior intentional? How does the np.asarray access the original masked values? Shouldn't the masked values be at least filled with fill_value? Thanks, Faraz
3786
Age (days ago)
3786
Last active (days ago)
2 comments
3 participants
participants (3)
-
Eric Firing
-
Faraz Mirzaei
-
Stéfan van der Walt