Python - How can I aggregate a pandas dataframe base on conditions on different rows

welcome to shbcf.ru