summaryrefslogtreecommitdiff
path: root/numpy/lib/function_base.py
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2017-07-13 13:10:59 +0100
committerEric Wieser <wieser.eric@gmail.com>2017-07-13 13:12:55 +0100
commit1f4ba5bee1240cc7a888087dc06acb7709f12870 (patch)
tree3dd0cde1241ab52c46177e04d1648a0abe9ad63a /numpy/lib/function_base.py
parent24508c1220a608df116db9035df30418bfc74a9b (diff)
downloadnumpy-1f4ba5bee1240cc7a888087dc06acb7709f12870.tar.gz
MAINT: Use clearer variable
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r--numpy/lib/function_base.py2
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():