[Numpy-discussion] numpy.arrange not returning expected results (bug?)

Simon Lieschke simon.lieschke at orionhealth.com
Wed Oct 17 21:34:56 EDT 2012


Hi,

I've discovered calling numpy.arange(1.1, 17.1) and numpy(1.1, 16.1) both
return the same results. Could this be a numpy bug, or is there some
behaviour I'm possibly not aware of here?

I've pasted in the results of an interactive Python session comparing and
contrasting these with some other similar calls.

I'm using NumPy 1.6.2.

Thanks in advance,


Simon

14:21:46.77 @ C:\Users\simon
>python
Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)]
on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> np.arange(1.1, 17.1)
array([  1.1,   2.1,   3.1,   4.1,   5.1,   6.1,   7.1,   8.1,   9.1,
        10.1,  11.1,  12.1,  13.1,  14.1,  15.1,  16.1])
>>> np.arange(1.1, 16.1)
array([  1.1,   2.1,   3.1,   4.1,   5.1,   6.1,   7.1,   8.1,   9.1,
        10.1,  11.1,  12.1,  13.1,  14.1,  15.1,  16.1])
>>> np.arange(1.1, 15.1)
array([  1.1,   2.1,   3.1,   4.1,   5.1,   6.1,   7.1,   8.1,   9.1,
        10.1,  11.1,  12.1,  13.1,  14.1])
>>> np.arange(1, 17)
array([ 1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16])
>>> np.arange(1, 16)
array([ 1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15])
>>> np.arange(1, 15)
array([ 1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14])



More information about the NumPy-Discussion mailing list