summaryrefslogtreecommitdiff
path: root/numpy/core/numeric.py
diff options
context:
space:
mode:
authorJulian Taylor <juliantaylor108@gmail.com>2017-02-25 16:39:43 +0100
committerGitHub <noreply@github.com>2017-02-25 16:39:43 +0100
commiteb271d95c0c9f3821009330d858a261b4b861bfe (patch)
tree4e076b45c91eacce30cdbdc0f3b80cad1118dcdd /numpy/core/numeric.py
parente9246860480b6c909e6e00c1cd4371b0e5fee1ce (diff)
parent38ce8097749ad69494926036250ed5b2de66184c (diff)
downloadnumpy-eb271d95c0c9f3821009330d858a261b4b861bfe.tar.gz
Merge pull request #8685 from eric-wieser/shape-to-ndim
ENH: add dtype.ndim
Diffstat (limited to 'numpy/core/numeric.py')
-rw-r--r--numpy/core/numeric.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py
index d4d4045a0..896ad7f6a 100644
--- a/numpy/core/numeric.py
+++ b/numpy/core/numeric.py
@@ -1354,9 +1354,9 @@ def tensordot(a, b, axes=2):
a, b = asarray(a), asarray(b)
as_ = a.shape
- nda = len(a.shape)
+ nda = a.ndim
bs = b.shape
- ndb = len(b.shape)
+ ndb = b.ndim
equal = True
if na != nb:
equal = False
@@ -1461,7 +1461,7 @@ def roll(a, shift, axis=None):
else:
broadcasted = broadcast(shift, axis)
- if len(broadcasted.shape) > 1:
+ if broadcasted.ndim > 1:
raise ValueError(
"'shift' and 'axis' should be scalars or 1D sequences")
shifts = {ax: 0 for ax in range(a.ndim)}