np.compress returns a copy without the nans, this function only works on 1d arrays