Created
October 27, 2015 20:53
-
-
Save cpelley/ed5e523f3e17ff5bf102 to your computer and use it in GitHub Desktop.
numpy masked array bug
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> import numpy as np | |
>>> arr = np.ma.array([1, 2, 3, 4], mask=[False, True, False, True]) | |
>>> arr2 = arr.reshape((2, 2)) | |
>>> arr2 | |
masked_array(data = | |
[[1 --] | |
[3 --]], | |
mask = | |
[[False True] | |
[False True]], | |
fill_value = 999999) | |
>>> arr2[:] = 10 | |
>>> arr | |
masked_array(data = [10 -- 10 --], | |
mask = [False True False True], | |
fill_value = 999999) | |
>>> arr2 | |
masked_array(data = | |
[[10 10] | |
[10 10]], | |
mask = | |
[[False False] | |
[False False]], | |
fill_value = 999999) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment