diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-07-07 08:18:02 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-07-07 08:18:02 +0000 |
commit | 80f1d7825004f8be40fa265eaaf165471467112d (patch) | |
tree | 77cac0aee76daab0016121de404830e9fd553dc2 /numpy/core/ma.py | |
parent | ddfe20b98506f0e0eb5f27286dc515ccab4b44a8 (diff) | |
download | numpy-80f1d7825004f8be40fa265eaaf165471467112d.tar.gz |
Remove .M .A .H attribute. Keep .T attribute as .transpose for >=2d. Creates 2-d from 1-d and returns self for 0-d. Fix-up flag-checking when stride 0 is coupled with dim == 1
Diffstat (limited to 'numpy/core/ma.py')
-rw-r--r-- | numpy/core/ma.py | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/numpy/core/ma.py b/numpy/core/ma.py index 4a2c51e5d..6231ed5c7 100644 --- a/numpy/core/ma.py +++ b/numpy/core/ma.py @@ -1391,21 +1391,14 @@ array(data = %(data)s, def _get_ctypes(self): return self._data.ctypes - def _get_M(self): - if self._mask is nomask: - return self._data.M - return self.filled().M - - def _get_A(self): - if self._mask is nomask: - return self._data.A - return self.filled().A - def _get_T(self): - return self.swapaxes(-2,-1) - - def _get_H(self): - return self.conjugate().swapaxes(-2,-1) + if (self.ndim == 0): + return self + if (self.ndim == 1): + ret = self.view() + ret.shape = (self.shape[0], 1) + return ret + return self.transpose() shape = property(_get_shape, _set_shape, doc = 'tuple giving the shape of the array') @@ -1422,10 +1415,8 @@ array(data = %(data)s, imag = imaginary ctypes = property(_get_ctypes, None, doc="ctypes") - M = property(_get_M, None, doc="get matrix") - A = property(_get_A, None, doc="get array") + T = property(_get_T, None, doc="get transpose") - H = property(_get_H, None, doc="get conj. transpose") #end class MaskedArray @@ -1871,7 +1862,7 @@ def swapaxes (a, axis1, axis2): def take (a, indices, axis=0): - "take(a, indices, axis=0) returns selection of items from a." + "returns selection of items from a." m = getmask(a) # d = masked_array(a).raw_data() d = masked_array(a).data @@ -1882,7 +1873,7 @@ def take (a, indices, axis=0): mask = numeric.take(m, indices, axis)) def transpose(a, axes=None): - "transpose(a, axes=None) reorder dimensions per tuple axes" + "reorder dimensions per tuple axes" m = getmask(a) d = filled(a) if m is nomask: @@ -1893,7 +1884,7 @@ def transpose(a, axes=None): def put(a, indices, values): - """put(a, indices, values) sets storage-indexed locations to corresponding values. + """sets storage-indexed locations to corresponding values. Values and indices are filled if necessary. |