def clean0(matrix):
 colsum = np.add.reduce((matrix ** 2), 0)
 val = [matrix[:, i] for i in np.flatnonzero(colsum)]
 return np.array(np.transpose(val))

def clean0 ( matrix ) : colsum = np . add . reduce ( ( matrix ** 2 ) , 0 ) val = [ matrix [ : , i ] for i in np . flatnonzero ( colsum ) ] return np . array ( np . transpose ( val ) )
erase columns of zeros: can save some time in pseudoinverse .