[SciPy-user] Replacing elements in matrix
dimitri.dor at fssintl.com
Mon Apr 25 04:19:44 CDT 2005
I come from the Matlab world and I'm used to write operations such as:
where A is a n by n matrix, indexi is i by 1 vector, indexj is a j by 1
vector and B is a i by j matrix.
With this operation, some of the elements of A are replaced by their
original value augmented by some value coming from B.
for example, take
With this, Matlab results would be
A[indexi,indexj]=array([[5, 7, 2],[4, 6, 2]])
I would like to make the same operation with Python. Would you please
propose me a compact code for achieving that?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-user