diff options
author | Robert Kern <robert.kern@gmail.com> | 2005-09-29 10:08:49 +0000 |
---|---|---|
committer | Robert Kern <robert.kern@gmail.com> | 2005-09-29 10:08:49 +0000 |
commit | 56728d50e7e23f541c2f599a831c49a74b75db57 (patch) | |
tree | b96683cf1cfaf4e402c9e87eccd4e33b29507f3e /scipy/base/function_base.py | |
parent | 305fabee5b1cf1d03ace5e4aa4bb66b41a358f05 (diff) | |
download | numpy-56728d50e7e23f541c2f599a831c49a74b75db57.tar.gz |
r3532@Blasphemy: kern | 2005-09-29 03:08:25 -0700
More test fixes
Diffstat (limited to 'scipy/base/function_base.py')
-rw-r--r-- | scipy/base/function_base.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/scipy/base/function_base.py b/scipy/base/function_base.py index 4f7e76d82..6e55b6521 100644 --- a/scipy/base/function_base.py +++ b/scipy/base/function_base.py @@ -447,12 +447,14 @@ def diff(x, n=1,axis=-1): return x if n<0: raise ValueError,'Order must be non-negative but got ' + `n` - x = x.ravel() + x = asarray(x) nd = len(x.shape) slice1 = [slice(None)]*nd slice2 = [slice(None)]*nd slice1[axis] = slice(1,None) slice2[axis] = slice(None,-1) + slice1 = tuple(slice1) + slice2 = tuple(slice2) if n > 1: return diff(x[slice1]-x[slice2], n-1, axis=axis) else: |