Pandas Simple Groupby
\n\n# Code\n\nimport pandas as pd\n\ndef total_time(employees: pd.DataFrame) -> pd.DataFrame:\n    \n    employees[\'total_time\'] = employees[\'out_time\'] - e
\n\n# Code\n```\nimport pandas as pd\n\ndef total_time(employees: pd.DataFrame) -> pd.DataFrame:\n    \n    employees[\'total_time\'] = employees[\'out_time\'] - employees[\'in_time\']\n\n    empl = employees.groupby(by=[\'emp_id\',\'event_day\'],as_index=False).sum()\n\n    return empl[[\'event_day\',\'emp_id\',\'total_time\']].rename(columns={\'event_day\':\'day\'})\n```
['Pandas']