summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
Diffstat (limited to 'numpy')
-rw-r--r--numpy/ma/core.py4
-rw-r--r--numpy/ma/tests/test_core.py9
2 files changed, 11 insertions, 2 deletions
diff --git a/numpy/ma/core.py b/numpy/ma/core.py
index e1e848206..38076e8b3 100644
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -3438,12 +3438,12 @@ class MaskedArray(ndarray):
return np.asanyarray(fill_value)
#
if m.dtype.names:
- result = self._data.copy()
+ result = self._data.copy('K')
_recursive_filled(result, self._mask, fill_value)
elif not m.any():
return self._data
else:
- result = self._data.copy()
+ result = self._data.copy('K')
try:
np.copyto(result, fill_value, where=m)
except (TypeError, AttributeError):
diff --git a/numpy/ma/tests/test_core.py b/numpy/ma/tests/test_core.py
index f14891087..263a9735a 100644
--- a/numpy/ma/tests/test_core.py
+++ b/numpy/ma/tests/test_core.py
@@ -537,6 +537,15 @@ class TestMaskedArray(TestCase):
assert_equal(test, control)
+ def test_filled_w_f_order(self):
+ "Test filled w/ F-contiguous array"
+ a = array(np.array([(0, 1, 2), (4, 5, 6)], order='F'),
+ mask=np.array([(0, 0, 1), (1, 0, 0)], order='F'),
+ order='F') # this is currently ignored
+ self.assertTrue(a.flags['F_CONTIGUOUS'])
+ self.assertTrue(a.filled(0).flags['F_CONTIGUOUS'])
+
+
def test_optinfo_propagation(self):
"Checks that _optinfo dictionary isn't back-propagated"
x = array([1, 2, 3, ], dtype=float)