diff options
author | Julian Taylor <juliantaylor108@gmail.com> | 2017-02-25 16:39:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-25 16:39:43 +0100 |
commit | eb271d95c0c9f3821009330d858a261b4b861bfe (patch) | |
tree | 4e076b45c91eacce30cdbdc0f3b80cad1118dcdd /numpy/lib/user_array.py | |
parent | e9246860480b6c909e6e00c1cd4371b0e5fee1ce (diff) | |
parent | 38ce8097749ad69494926036250ed5b2de66184c (diff) | |
download | numpy-eb271d95c0c9f3821009330d858a261b4b861bfe.tar.gz |
Merge pull request #8685 from eric-wieser/shape-to-ndim
ENH: add dtype.ndim
Diffstat (limited to 'numpy/lib/user_array.py')
-rw-r--r-- | numpy/lib/user_array.py | 4 |
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( |