diff options
author | gfyoung <gfyoung17@gmail.com> | 2016-09-11 01:02:19 -0400 |
---|---|---|
committer | gfyoung <gfyoung17@gmail.com> | 2016-09-11 13:42:44 -0400 |
commit | fa369d17e110717535860d8caea5bec44da53f42 (patch) | |
tree | 4dc7233fefd0bcb7ab4906b8a8cb35640d1b212a /numpy/core/numeric.py | |
parent | cb7f4078bf94cde6233b9128f138ba18e04c1d1d (diff) | |
download | numpy-fa369d17e110717535860d8caea5bec44da53f42.tar.gz |
DOC, MAINT: Update error message in rollaxis.
Updates error message to properly reflect
that the 'start' or 'axis' can be negative.
Closes gh-7974.
Diffstat (limited to 'numpy/core/numeric.py')
-rw-r--r-- | numpy/core/numeric.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index ad2dcc291..81d9d3697 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -1531,12 +1531,12 @@ def rollaxis(a, axis, start=0): axis += n if start < 0: start += n - msg = 'rollaxis: %s (%d) must be >=0 and < %d' + msg = "'%s' arg requires %d <= %s < %d, but %d was passed in" if not (0 <= axis < n): - raise ValueError(msg % ('axis', axis, n)) + raise ValueError(msg % ('axis', -n, 'axis', n, axis)) if not (0 <= start < n + 1): - raise ValueError(msg % ('start', start, n + 1)) - if (axis < start): + raise ValueError(msg % ('start', -n, 'start', n + 1, start)) + if axis < start: # it's been removed start -= 1 if axis == start: |