diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2019-05-02 22:36:12 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-02 22:36:12 -0700 |
commit | f64ec0ca21466d3d461b88e232451c750982e9e6 (patch) | |
tree | 8274b398babaa0bed1208c70a1bf0dcbbcac2431 /numpy/lib/function_base.py | |
parent | 4b6b29afc06a639975d08f2e95dc3e1c36486188 (diff) | |
parent | d7de4ad70d6794b36e4789e4f6146a884113bd66 (diff) | |
download | numpy-f64ec0ca21466d3d461b88e232451c750982e9e6.tar.gz |
Merge pull request #13298 from navneet-nmk/diff-error
ENH: Added clearer exception for np.diff on 0-dimensional ndarray
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 cab680751..7fa51d683 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 = [] |