diff options
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/tests/test_regression.py | 5 | ||||
-rw-r--r-- | numpy/oldnumeric/random_array.py | 10 |
2 files changed, 9 insertions, 6 deletions
diff --git a/numpy/core/tests/test_regression.py b/numpy/core/tests/test_regression.py index 85fa82fe1..e5fb33a73 100644 --- a/numpy/core/tests/test_regression.py +++ b/numpy/core/tests/test_regression.py @@ -697,6 +697,11 @@ class test_regression(NumpyTestCase): x = N.array(['a']*32) assert_array_equal(x.argsort(kind='m'), N.arange(32)) + def check_numeric_random(self, level=rlevel): + """Ticket #552""" + from numpy.oldnumeric.random_array import randint + randint(0,50,[2,3]) + if __name__ == "__main__": NumpyTest().run() diff --git a/numpy/oldnumeric/random_array.py b/numpy/oldnumeric/random_array.py index 0b06ee959..2f5479c1f 100644 --- a/numpy/oldnumeric/random_array.py +++ b/numpy/oldnumeric/random_array.py @@ -12,8 +12,6 @@ ArgumentError = ValueError import numpy.random.mtrand as mt import numpy as Numeric -from types import IntType - def seed(x=0, y=0): if (x == 0 or y == 0): mt.seed() @@ -42,16 +40,16 @@ def uniform(minimum, maximum, shape=[]): def randint(minimum, maximum=None, shape=[]): """randint(min, max, shape=[]) = random integers >=min, < max If max not given, random integers >= 0, <min""" - if not isinstance(minimum, IntType): + if not isinstance(minimum, int): raise ArgumentError, "randint requires first argument integer" if maximum is None: maximum = minimum minimum = 0 - if not isinstance(maximum, IntType): + if not isinstance(maximum, int): raise ArgumentError, "randint requires second argument integer" a = ((maximum-minimum)* random(shape)) - if isinstance(a, Numeric.ArrayType): - return minimum + a.astype(Numeric.Int) + if isinstance(a, Numeric.ndarray): + return minimum + a.astype(Numeric.int) else: return minimum + int(a) |