diff options
author | ayir <navneet.nmk@gmail.com> | 2019-04-10 17:00:25 +0200 |
---|---|---|
committer | mattip <matti.picus@gmail.com> | 2019-04-26 09:05:23 -0700 |
commit | d7de4ad70d6794b36e4789e4f6146a884113bd66 (patch) | |
tree | 5faaa6463ebdb099eeca171fcf2312e69fd0e807 /numpy/lib/function_base.py | |
parent | 412975de43e6c5e4b6f1051f3a04968c629240c7 (diff) | |
download | numpy-d7de4ad70d6794b36e4789e4f6146a884113bd66.tar.gz |
ENH: add clearer error message for diff(0-d)
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r-- | numpy/lib/function_base.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index fb40ef927..7a405b382 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -1235,6 +1235,8 @@ def diff(a, n=1, axis=-1, prepend=np._NoValue, append=np._NoValue): a = asanyarray(a) nd = a.ndim + if nd == 0: + raise ValueError("diff requires input that is at least one dimensional") axis = normalize_axis_index(axis, nd) combined = [] |