Numeric don't compare arrays correctly

Maurix maurix78_remove_this_ at wanadoo.es
Thu Jun 5 17:50:21 EDT 2003


Hi to all,
I'm new in python world and in this group too so, nice to meet you all ;-)
I have a problem with Numeric: (linux, python2.2, numeric 21.0)

It seem that don't compare correctly arrays.

See at this session:

 >>> a=array([1.1,2.2,3.3,4.4,5.5])
 >>> print 2.<a<4.
[1 1 1 0 0] # 1.1 is not between 2 and 4 !!
 >>> print (a>2.)and(a<4.)
[1 1 1 0 0]
 >>> print (a>2.)*(a<4.)
[0 1 1 0 0] # this is good!

Bye and tnks,
Maurix.






More information about the Python-list mailing list