Python Filter Dataframe Based On Multiple Conditions In If Statement