diff options
author | Denis Laxalde <denis@laxalde.org> | 2012-10-13 15:46:43 +0200 |
---|---|---|
committer | Denis Laxalde <denis@laxalde.org> | 2012-10-13 15:58:24 +0200 |
commit | 8d83ae93706d3486447a9b40908995b406178111 (patch) | |
tree | 8358f5f489612f35b1ca15408398fc2c869c78dd /numpy/core/numeric.py | |
parent | be90de8e31b76db8154e8ab9cefc21c1d25d0f45 (diff) | |
download | numpy-8d83ae93706d3486447a9b40908995b406178111.tar.gz |
STY: drop some else clauses in roll
Diffstat (limited to 'numpy/core/numeric.py')
-rw-r--r-- | numpy/core/numeric.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index d26d9ded8..04010ec3c 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -1186,14 +1186,12 @@ def roll(a, shift, axis=None): reshape = False if n == 0: return a - else: - shift %= n - indexes = concatenate((arange(n-shift,n),arange(n-shift))) - res = a.take(indexes, axis) - if reshape: - return res.reshape(a.shape) - else: - return res + shift %= n + indexes = concatenate((arange(n - shift, n), arange(n - shift))) + res = a.take(indexes, axis) + if reshape: + res = res.reshape(a.shape) + return res def rollaxis(a, axis, start=0): """ |