doucmentation bug or bug? p or q for numerical arrays
Alan G Isaac
aisaac at american.edu
Thu Jul 29 06:06:44 CEST 2004
from Numeric import *
p = array([1, 1, 0, 0])
q = array([1, 0, 1, 0])
print logical_or(p,q) #expected result
print (p or q) #prints p
This might be expected, except for the documentation:
"Universal Functions, or ufunc s. The operators which invoke them when
applied to arrays are indicated in parentheses."
And then numarray has the same documentation (in the manual)
but chokes altogether on the use of 'or'.
There is a like problem with 'and'.
Am I misreading something?
Are there actually operators for these functions?
PS A comment: operators are really useful here. Using the ufuncs
makes for very messy code. See the GAUSS programming
language for a nice syntax.
More information about the Python-list