Applying group selection conditions using groupeddataframes

Thanks for sharing this solution!

Do you think it’s worth referencing this problem in the DataFrames Development Survey?