diff options
Diffstat (limited to 'numpy/core/defmatrix.py')
-rw-r--r-- | numpy/core/defmatrix.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/numpy/core/defmatrix.py b/numpy/core/defmatrix.py index ca7240757..c74100dda 100644 --- a/numpy/core/defmatrix.py +++ b/numpy/core/defmatrix.py @@ -223,6 +223,8 @@ class matrix(N.ndarray): return def __getitem__(self, index): + if isscalar(index): + return self.__array__()[index] self._getitem = True try: @@ -472,11 +474,6 @@ class matrix(N.ndarray): def ptp(self, axis=None, out=None): return N.ndarray.ptp(self, axis, out)._align(axis) - # Needed becase tolist method expects a[i] - # to have dimension a.ndim-1 - def tolist(self): - return self.__array__().tolist() - def getI(self): M,N = self.shape if M == N: |