Python Keep Rows Based On Conditional Diffusion