[Numpy-discussion] Subarray with with arbitrary index?

Huaiyu Zhu huaiyu_zhu at yahoo.com
Fri Aug 17 02:30:20 EDT 2001


Is it possible to assign to a subarray with arbitrary index?

Suppose I have three arrays

a = arange(8)
b = array([2, 3, 5])
c = arange(3)+100

I want a function f, such that calling  f(a, b, c) would change a to

[0 1 100 101 4 102 6 7]

This would be useful in certain applications that would otherwise
require sparse matrices.   

Huaiyu Zhu

More information about the NumPy-Discussion mailing list