diff options
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r-- | numpy/lib/function_base.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index b616011d1..32c999dfc 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -1701,7 +1701,7 @@ def gradient(f, *varargs, **kwargs): if len(distances) != f.shape[axes[i]]: raise ValueError("when 1d, distances must match " "the length of the corresponding dimension") - diffx = np.diff(dx[i]) + diffx = np.diff(distances) # if distances are constant reduce to the scalar case # since it brings a consistent speedup if (diffx == diffx[0]).all(): |