[Numpy-discussion] more complex matrix operation

2010-03-15 Thread Gerardo Berbeglia
I have another matrix operations which seems a little more complicated. Let A be an n x n matrix and let S be a subset of {0,...,n-1}. Assume S is represented by a binary vector s, with a 1 at the index i if i is in S. (e.g. if S={0,3} then s = [1,0,0,1]) I would like to have an efficient way to

[Numpy-discussion] another matrix operation

2010-03-15 Thread Gerardo Berbeglia
I would like to do with numpy the following operation. Let A be an n x n matrix and let s be an integer between 1 and n. I would like to have an n x n matrix B = f(A,s) such that - If we only look at the first s columns of B, we will not see any difference with respect to the first s columns of