# Removes columns where the training data is all nan if not np.any(mask): return X[:, valid_mask]