March 2003
Intermediate to advanced
656 pages
39h 30m
English
choose
choose(a,values)
Returns an array c with the same shape as
a. values is a
sequence. a’s elements
are integers between 0, included, and
len(
values
),
excluded. Each element of c is the item of
values whose index is the corresponding
element of a. For example:
print Numeric.choose(Numeric.identity(3),'ox') # prints: [[x o o] # [o x o] # [o o x]]
Read now
Unlock full access