Numerical Python Bug ?

Uwe Schmitt uwe at
Wed Nov 7 18:48:25 CET 2001


during a *large computation* I get problems with vectors / arrays:

     print sp


    [ 100, 50,]


     print 0.5*sp


    [ 0, 0, ]

type(sp) is "array" and type(sp[0]) is "float".

What makes me wonder is the output format. "print sp" should give

    [ 100., 50. ]

which is different from my result above...

Further: if I use

     print 1/2.0*sp

i get the correct result 

     [50, 25,]

Is there a bug in NumPy or Python respectively ???

Last but not least: If I use 

     print alpha

I get 0.0 as output !!!

One remark: all the behaviour above does not happen if I enter some vectors

Yours, Uwe.

Dr. Uwe Schmitt                                 Uwe.Schmitt at
Universitaet des Saarlandes                     Angewandte Mathematik
Building 36.1 Room 4.17         PO-Box 151150   D-66041 Saarbruecken
Mobile:0177/6806587    Fax:+49(0)681/302-4435   Office:+49(0)681/302-2468

More information about the Python-list mailing list