March 2003
Intermediate to advanced
656 pages
39h 30m
English
put
put(a,indices,values)
a must be a contiguous array.
indices is a sequence of integers, taken
as indices into a
.flat.
values is a sequence of values that can be
converted to a’s type
code (if shorter than indices,
values is repeated as needed). Each
element of a indicated by an item in
indices is replaced by the corresponding
item in values. put is
therefore similar to (but faster than) the loop:
for i,v in zip(indices,values*len(indices)):
a.flat[i]=vRead now
Unlock full access