[MATRIX-SIG] two possible bugs?

Janko Hauser jhauser@ifm.uni-kiel.de
Tue, 17 Mar 1998 00:00:20 +0100 (CET)


Hello, during some tests of UserArray I have found these oddities:

>>> a=reshape(arange(9),(3,3))
>>> repeat(a,(2,))
zsh: 13051 segmentation fault  python -i /home/hauser/SYNC/.python/Startup.py

~@sines >py
>>> a=reshape(arange(9),(3,3))
>>> repeat(a[NewAxis,:,:],(2,))
array([[[0, 1, 2],
        [3, 4, 5],
        [6, 7, 8]],
       [[0, 1, 2],
        [3, 4, 5],
        [6, 7, 8]]])
>>> (repeat(a[NewAxis,:,:],(2,))).shape
(2, 3, 3)

This is with a Python and NumPy from the LLNL source tree on
Linux(libc6). Is this also the case on other platforms?

And then something I don't understand:

>>> a=array(10)
>>> a.shape
()
>>> a[0]
10
>>> b=array([10])
>>> b.shape
(1,)
>>> b[0]
10
>>> a[-1]
Traceback (innermost last):
  File "<stdin>", line 1, in ?
IndexError: index out of bounds
>>> b[-1]
10

Shouldn't a and b not be the same?

__Janko



_______________
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
_______________