summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2018-01-10 11:06:39 -0700
committerGitHub <noreply@github.com>2018-01-10 11:06:39 -0700
commit44dfa42eeb8db02a70b5981165116d76e8d4ea0e (patch)
tree6b3b1ec34a0b0bf7f2752c28e657bea14d57e874
parentc2c10236229cab281178ce07e34cc1817fef407d (diff)
parent3bbd303e7e15577c5c4dd05b7e858d15bc04bc59 (diff)
downloadnumpy-44dfa42eeb8db02a70b5981165116d76e8d4ea0e.tar.gz
Merge pull request #10354 from kmaehashi/fix-einsum-errmsg
BUG: fix error message not formatted in einsum
-rw-r--r--numpy/core/einsumfunc.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/numpy/core/einsumfunc.py b/numpy/core/einsumfunc.py
index c5b37b7e2..b7e81385f 100644
--- a/numpy/core/einsumfunc.py
+++ b/numpy/core/einsumfunc.py
@@ -700,14 +700,15 @@ def einsum_path(*operands, **kwargs):
sh = operands[tnum].shape
if len(sh) != len(term):
raise ValueError("Einstein sum subscript %s does not contain the "
- "correct number of indices for operand %d.",
- input_subscripts[tnum], tnum)
+ "correct number of indices for operand %d."
+ % (input_subscripts[tnum], tnum))
for cnum, char in enumerate(term):
dim = sh[cnum]
if char in dimension_dict.keys():
if dimension_dict[char] != dim:
raise ValueError("Size of label '%s' for operand %d does "
- "not match previous terms.", char, tnum)
+ "not match previous terms."
+ % (char, tnum))
else:
dimension_dict[char] = dim