Some slices of Numeric.array are wrong
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-numeric (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: python-numeric
This is Hardy on x86_64 with python-numeric 24.2-8ubuntu2:
$ python
Python 2.5.2 (r252:60911, Jul 31 2008, 17:31:22)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Numeric
>>> Numeric.
zeros((0, 2), 's')
>>> Numeric.
array([ [30, 40]],'s')
The result of the slice with [1:] is wrong. It should be the same as the second slice. The bug seems to affect one-dimensional array slices with no ending point.
The bug is not present in Intrepid on x86 (Python 2.5.2 (r252:60911, Aug 6 2008, 09:17:42; [GCC 4.3.1]; python-numeric 24.2-9).
An application affected by this bug is ttx from fonttools.
description: | updated |
Same problem in karmic 9.10 x64 (Numeric 24.2, python 2.6.4 and
2.5.4).
It may be a 64/32bit problem, since it doesn't happen on my
32bit 9.04 machines (don't have a 32bit 9.10 install to test)
The problem is that an unspecified stride gets set to 0 under some
circumstances. Here's a minimal fragment to show the problem:
>>> Import Numeric, numpy arange( 1,5)[2: ] 1,5)[2: ]
>>> Numeric.
>>> zeros((0,), 'l')
>>> numpy.arange(
array([3, 4])
>>> range(1,5)[2:]
[3, 4]
numpy and builtin range show the correct behavior, Numeric's
wrong. This is a fairly serious problem for people using Numeric
for number crunching..