[PYTHON MATRIX-SIG] Bug

Konrad Hinsen hinsen@ibs.ibs.fr
Thu, 24 Oct 96 15:02:31 +0100


> I get a core dump on the following:
> 
> >>> from Numeric import *
> >>> a = array(3)
> >>> a[:,NewAxis]
> Segmentation fault (core dumped)
> 
> Does that happen to anyone else?

No:

Python 1.4b3 (October 13 1995) [C]
Copyright 1991-1996 Stichting Mathematisch Centrum, Amsterdam
>>> from Numeric import *
from Numeric import *
>>> a = array(3)
a = array(3)
>>> a[:,NewAxis]
a[:,NewAxis]
EmptyArray
>>>

(Note that the error message is not quite correct - this is
not an empty array, but a rank-0 array.)

Nevertheless, array() should probably return a scalar in this
case. Otherwise there is a backdoor to create rank-0 arrays
that can create lots of confusion.

Konrad.
-- 
-------------------------------------------------------------------------------
Konrad Hinsen                          | E-Mail: hinsen@ibs.ibs.fr
Laboratoire de Dynamique Moleculaire   | Tel.: +33-76.88.99.28
Institut de Biologie Structurale       | Fax:  +33-76.88.54.94
41, av. des Martyrs                    | Deutsch/Esperanto/English/
38027 Grenoble Cedex 1, France         | Nederlands/Francais
-------------------------------------------------------------------------------

=================
MATRIX-SIG  - SIG on Matrix Math for Python

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