summaryrefslogtreecommitdiff
path: root/numpy/lib/shape_base.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2011-04-05 15:01:52 -0600
committerCharles Harris <charlesr.harris@gmail.com>2011-04-05 17:38:00 -0600
commitcfd766456368777bcb0d5edabd360b3aeb02d3f8 (patch)
treeb38cd1bf7520faba8e2c0268e85253df7fe1f23f /numpy/lib/shape_base.py
parenta4100ba6c440bdf2a2b3cfc31995eb5e009846ee (diff)
downloadnumpy-cfd766456368777bcb0d5edabd360b3aeb02d3f8.tar.gz
STY: Update exception style, easy ones.
Diffstat (limited to 'numpy/lib/shape_base.py')
-rw-r--r--numpy/lib/shape_base.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/numpy/lib/shape_base.py b/numpy/lib/shape_base.py
index 5ea2648cb..719cf0814 100644
--- a/numpy/lib/shape_base.py
+++ b/numpy/lib/shape_base.py
@@ -383,7 +383,7 @@ def array_split(ary,indices_or_sections,axis = 0):
except TypeError: #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.')
Neach_section,extras = divmod(Ntotal,Nsections)
section_sizes = [0] + \
extras * [Neach_section+1] + \
@@ -474,7 +474,7 @@ def split(ary,indices_or_sections,axis=0):
sections = indices_or_sections
N = ary.shape[axis]
if N % sections:
- raise ValueError, 'array split does not result in an equal division'
+ raise ValueError('array split does not result in an equal division')
res = array_split(ary,indices_or_sections,axis)
return res
@@ -534,7 +534,7 @@ def hsplit(ary,indices_or_sections):
"""
if len(_nx.shape(ary)) == 0:
- raise ValueError, 'hsplit only works on arrays of 1 or more dimensions'
+ raise ValueError('hsplit only works on arrays of 1 or more dimensions')
if len(ary.shape) > 1:
return split(ary,indices_or_sections,1)
else:
@@ -588,7 +588,7 @@ def vsplit(ary,indices_or_sections):
"""
if len(_nx.shape(ary)) < 2:
- raise ValueError, 'vsplit only works on arrays of 2 or more dimensions'
+ raise ValueError('vsplit only works on arrays of 2 or more dimensions')
return split(ary,indices_or_sections,0)
def dsplit(ary,indices_or_sections):
@@ -633,7 +633,7 @@ def dsplit(ary,indices_or_sections):
"""
if len(_nx.shape(ary)) < 3:
- raise ValueError, 'vsplit only works on arrays of 3 or more dimensions'
+ raise ValueError('vsplit only works on arrays of 3 or more dimensions')
return split(ary,indices_or_sections,2)
def get_array_prepare(*args):