I am trying to add selective columns from one matrix to another matrix in loop when condition becomes true. I have tried various combinations but it adds in rows with np.append etc commands, Any help is appreciated. Thanks
I have tried np.append, np.concatenation, np.hstack commands but not getting the desired soltuion.
n,m=np.shape(K)
Z=np.array([])
for number in range(m):
A=function
if A<0.05:
Z = np.append(Z,np.vstack(K[:,number]))
I want Z matrix with columns of K that satisfy the condition A. Like Z=[K[:,3] K[:,8] K[:,10]]