summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhay Raghuvanshi <abhayaman669@gmail.com>2021-02-11 02:18:18 +0530
committerGitHub <noreply@github.com>2021-02-10 14:48:18 -0600
commit6d8956e46026b68a4c2a50f1aab0c4f36a46053d (patch)
tree6b60fb5ddc6c1884c6343047a3c3d99dd1140b97
parent26e0003573463d0c5ca6c07289cd5151b4dba3b2 (diff)
downloadnumpy-6d8956e46026b68a4c2a50f1aab0c4f36a46053d.tar.gz
Fixed chain exception for array_split func (#18317)
-rw-r--r--numpy/lib/shape_base.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/lib/shape_base.py b/numpy/lib/shape_base.py
index 9dfeee527..d19bfb8f8 100644
--- a/numpy/lib/shape_base.py
+++ b/numpy/lib/shape_base.py
@@ -775,7 +775,7 @@ def array_split(ary, indices_or_sections, axis=0):
# indices_or_sections is a scalar, not an array.
Nsections = int(indices_or_sections)
if Nsections <= 0:
- raise ValueError('number sections must be larger than 0.')
+ raise ValueError('number sections must be larger than 0.') from None
Neach_section, extras = divmod(Ntotal, Nsections)
section_sizes = ([0] +
extras * [Neach_section+1] +