[q, r] = np.linalg.qr(np.array([1, 0, 0, 0, 1, 1, 1, 1, 1]).reshape(3, 3))
mask = np.all(np.abs(r) < 1e-06, axis=1)
pos = np.where(np.diff(mask))[0] + 1
result = np.split(r, pos)
remove zero lines 2-D numpy array