summaryrefslogtreecommitdiff
path: root/numpy/core/defmatrix.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/core/defmatrix.py')
-rw-r--r--numpy/core/defmatrix.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/numpy/core/defmatrix.py b/numpy/core/defmatrix.py
index 8ac75acf1..0c18dfb91 100644
--- a/numpy/core/defmatrix.py
+++ b/numpy/core/defmatrix.py
@@ -223,8 +223,6 @@ class matrix(N.ndarray):
return
def __getitem__(self, index):
- if isscalar(index):
- return self.__array__()[index]
self._getitem = True
try:
@@ -304,6 +302,11 @@ class matrix(N.ndarray):
else:
raise ValueError, "unsupported axis"
+ # Necessary because base-class tolist expects dimension
+ # reduction by x[0]
+ def tolist(self):
+ return self.__array__().tolist()
+
# To preserve orientation of result...
def sum(self, axis=None, dtype=None, out=None):
"""Sum the matrix over the given axis. If the axis is None, sum