summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorpierregm <pierregm@localhost>2009-01-10 01:53:05 +0000
committerpierregm <pierregm@localhost>2009-01-10 01:53:05 +0000
commit71194089c90f9c65cab1b15671491aa5a8c2e43c (patch)
tree196d3889b054cbc8f0bf73779ff2c27567139fd1 /numpy
parent7dfb0e620c2545c7860c05a66abc1b2429f8e415 (diff)
downloadnumpy-71194089c90f9c65cab1b15671491aa5a8c2e43c.tar.gz
* Add flatten_structured_array to the namespace
Diffstat (limited to 'numpy')
-rw-r--r--numpy/ma/core.py3
-rw-r--r--numpy/ma/tests/test_core.py14
2 files changed, 9 insertions, 8 deletions
diff --git a/numpy/ma/core.py b/numpy/ma/core.py
index cafe78b4d..1f87675d3 100644
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -34,7 +34,8 @@ __all__ = ['MAError', 'MaskError', 'MaskType', 'MaskedArray',
'default_fill_value', 'diag', 'diagonal', 'divide', 'dump', 'dumps',
'empty', 'empty_like', 'equal', 'exp', 'expand_dims',
'fabs', 'flatten_mask', 'fmod', 'filled', 'floor', 'floor_divide',
- 'fix_invalid', 'frombuffer', 'fromflex', 'fromfunction',
+ 'fix_invalid', 'flatten_structured_array', 'frombuffer', 'fromflex',
+ 'fromfunction',
'getdata','getmask', 'getmaskarray', 'greater', 'greater_equal',
'harden_mask', 'hypot',
'identity', 'ids', 'indices', 'inner', 'innerproduct',
diff --git a/numpy/ma/tests/test_core.py b/numpy/ma/tests/test_core.py
index 7f17b5f6e..090613f7e 100644
--- a/numpy/ma/tests/test_core.py
+++ b/numpy/ma/tests/test_core.py
@@ -518,20 +518,20 @@ class TestMaskedArray(TestCase):
assert_equal(test, control)
assert_equal(test.dtype, control.dtype)
# On masked_array
- a = ma.array([(1, 1), (2, 2)], mask=[(0, 1), (1, 0)], dtype=ndtype)
+ a = array([(1, 1), (2, 2)], mask=[(0, 1), (1, 0)], dtype=ndtype)
test = flatten_structured_array(a)
- control = ma.array([[1., 1.], [2., 2.]],
- mask=[[0, 1], [1, 0]], dtype=np.float)
+ control = array([[1., 1.], [2., 2.]],
+ mask=[[0, 1], [1, 0]], dtype=np.float)
assert_equal(test, control)
assert_equal(test.dtype, control.dtype)
assert_equal(test.mask, control.mask)
# On masked array with nested structure
ndtype = [('a', int), ('b', [('ba', int), ('bb', float)])]
- a = ma.array([(1, (1, 1.1)), (2, (2, 2.2))],
- mask=[(0, (1, 0)), (1, (0, 1))], dtype=ndtype)
+ a = array([(1, (1, 1.1)), (2, (2, 2.2))],
+ mask=[(0, (1, 0)), (1, (0, 1))], dtype=ndtype)
test = flatten_structured_array(a)
- control = ma.array([[1., 1., 1.1], [2., 2., 2.2]],
- mask=[[0, 1, 0], [1, 0, 1]], dtype=np.float)
+ control = array([[1., 1., 1.1], [2., 2., 2.2]],
+ mask=[[0, 1, 0], [1, 0, 1]], dtype=np.float)
assert_equal(test, control)
assert_equal(test.dtype, control.dtype)
assert_equal(test.mask, control.mask)