summaryrefslogtreecommitdiff
path: root/numpy/lib/user_array.py
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2017-02-24 16:46:58 +0000
committerEric Wieser <wieser.eric@gmail.com>2017-02-24 16:46:58 +0000
commit48783e5ceb7f60c33db81ab72e5024f42b220990 (patch)
tree2284b780e521418b0e73fd7283403d3e7e28da50 /numpy/lib/user_array.py
parent5f5ccecbfc116284ed8c8d53cd8b203ceef5f7c7 (diff)
downloadnumpy-48783e5ceb7f60c33db81ab72e5024f42b220990.tar.gz
MAINT: replace len(x.shape) with x.ndim
Diffstat (limited to 'numpy/lib/user_array.py')
-rw-r--r--numpy/lib/user_array.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/lib/user_array.py b/numpy/lib/user_array.py
index 62398fc3c..f1510a7b1 100644
--- a/numpy/lib/user_array.py
+++ b/numpy/lib/user_array.py
@@ -34,7 +34,7 @@ class container(object):
self.array = array(data, dtype, copy=copy)
def __repr__(self):
- if len(self.shape) > 0:
+ if self.ndim > 0:
return self.__class__.__name__ + repr(self.array)[len("array"):]
else:
return self.__class__.__name__ + "(" + repr(self.array) + ")"
@@ -183,7 +183,7 @@ class container(object):
return self._rc(invert(self.array))
def _scalarfunc(self, func):
- if len(self.shape) == 0:
+ if self.ndim == 0:
return func(self[0])
else:
raise TypeError(