[PYTHON MATRIX-SIG] bug, I claim

David Ascher da@maigret.cog.brown.edu
Tue, 21 May 1996 18:15:19 -0400 (EDT)


That the following happens is, I believe, unfortunate:

from Numeric import *
from Ranf import *

a = random_sample(10)

b = (a.greater(0.5).choose(0,0.1))
print b
0 0 0 0 0 0 0 0 0 0

c = (a.greater(0.5).choose(0.0,0.1))
print c

0.10000000 0.10000000 0.10000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
0.10000000 0.00000000


Why should the type of the first argument to choose() be valued over the
most generic type?



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

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